Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML How to Make a Website Adding Pages to a Website Add a New Page

mukul lohia
mukul lohia
985 Points

there is a space between header and imaged

/********** general **********/ body{ font-family: 'open sans',sans-serif; }

wrapper{

  max-width: 940px;

  margin: 0 auto;
  background:white;
  padding: 50% 5%;

} a { text-decoration: none; }

/*maximum image*/ img{ max-width:100%; }

/********** heading **********/ header{ margin: 0 0 30px 0; padding: 5px 0 0 0; width:100%; }

logo{

  text-align:center;
  margin: 10;}

h1{ font-family:'changa one', cursive; margin: 15 px,0; font-size:1.75em; font-weight: normal; line-height: 0.8em; } h2{ font-size: 0.75em; margin: -5px 0 0; font-weight: bold; } /********** navigation **********/ nav{ text-align:center; padding: 10px 0; margin: 20px 0 0; } nav ul{ list-style:none; margin:0 25px; padding:0; } nav ul li { display:inline-block; } nav a{ font-weight:800; padding: 15px,25px; }

/********** footer *******/ footer{ text-align:center; font-size: 0.75em; clear:both; padding: 50px; color: #ccc;} .social-icon{ width:20px; height:20px; margin: 0 5px; } /******* portfoilo **********/

gallery{

  margin:0;
  padding:0;
  list-style:none;

}

gallery li{

  float:left;
  width:45%;
  margin:2.5%;
  background-color:#fff;
  color:#f0f0f0;

}

gallery li a p{

  margin:0;
  padding:5%;
  font-size:0.75em;
  color:#bdc37c;

}

/********** colors *********/ /*site body/ body{ background-color: white; color:#999; } /* green header / header{ background-color:#6ab47b; border-color:#599a68;} / nav background for mobile devices*/ nav{ background-color:#599a68; } /* logo text*/ h1,h2{ color:white;} /* links*/ a { color: #6ab47b; } /* nav links*/ nav a, nav a:visited{ color:#fff;} /* selected nav link*/ nav a.selected,nav a:hover{ color:#32673f; } this is css coding

there is a huge space between header and my images how can i remove this space so that my page will be look good

<!DOCTYPE html> <html> <head> <meta charset="utf-8">

<title>MUKUL LOHIA|ENTREPRENEUR</title> <link rel="stylesheet" href="css/normalize.css"> <link href="https://fonts.googleapis.com/css?family=Changa+One|Open+Sans:400,400i,700,700i,800i" rel="stylesheet"> <link rel="stylesheet" href="css/main.css">

</head>

<body>

<header> <a href="untitled.html" id="logo"> <h1>MUKUL LOHIA </h1> <h2>ENTREPRENEUR</h2> </a> <nav> <ul> <li><a href="untitled.html" class="selected">portfolio</a></li> <li><a href="about.html">about</a></li> <li><a href="contact.html">contact</a></li></ul></nav> </header> <div id="wrapper"> <section> <ul id="gallery"> <li> <a href="img/numbers-01.jpg"> <img src="img/numbers-01.jpg" alt=""> <p>natural is good</p> </a>

            </li>
             <li>
                <a href="img/numbers-02.jpg">
                <img src="img/numbers-02.jpg" alt="">
             <p>natural is good</p>
                      </a>

            </li>
             <li>
                <a href="img/numbers-06.jpg">
                <img src="img/numbers-06.jpg" alt="">
             <p>natural is good</p>
                      </a>

            </li>
             <li>
                <a href="img/numbers-09.jpg">
                <img src="img/numbers-09.jpg" alt="">
             <p>natural is good</p>
                      </a>

            </li>
             <li>
                <a href="img/numbers-12.jpg">
                <img src="img/numbers-12.jpg" alt="">
             <p>natural is good</p>
                      </a>

            </li>

          </ul>
      </section>
  <footer>
    <p>&copy; 2016mukul lohia.</p>

    </footer>
          </div>
</body>

</html> this is my index.html code

pls check my code...

6 Answers

Marcin Lubke
Marcin Lubke
13,253 Points

I'm not sure what you mean by huge space and where it is, but I found two mistakes in your code:

nav a {
  font-weight:800; padding: 15px,25px; 
}

you don't use comma, should be space between the values:

nav a{
 font-weight:800; padding: 15px 25px; 
}

Here's the same situation with margin:

h1 {
 font-family:'changa one', cursive;
 margin: 15 px,0;
 font-size:1.75em;
 font-weight: normal;
 line-height: 0.8em; 
}

It should be:

h1 {
 font-family:'changa one', cursive;
 margin: 15 px 0;
 font-size:1.75em;
 font-weight: normal;
 line-height: 0.8em; 
}

I've also noticed, that it might be something with your wrapper declaration:

wrapper {
  max-width: 940px;
  margin: 0 auto;
  background:white;
  padding: 50% 5%;
}

Shouldn't there be padding: 0 5%?

mukul lohia
mukul lohia
985 Points

thanku so much sir now it's all good but there is one more problem when i click on about or contact page then i again click on portfolio then it is showing Not Found

The requested URL /untitled.html was not found on this server.

Marcin Lubke
Marcin Lubke
13,253 Points

Here's your problem. Change untitled.html to index.html. Of course, you must change it in all of your files (index, about and contact).

<header>
  <a href="untitled.html" id="logo">
    <h1>MUKUL LOHIA </h1>
    <h2>ENTREPRENEUR</h2>
 </a> 
 <nav> 
   <ul>
     <li><a href="untitled.html" class="selected">portfolio</a></li>
     <li><a href="about.html">about</a></li> 
     <li><a href="contact.html">contact</a></li>
   </ul>
 </nav> 
</header> 

So, after changing:

<header>
  <a href="index.html" id="logo">
    <h1>MUKUL LOHIA </h1>
    <h2>ENTREPRENEUR</h2>
 </a> 
 <nav> 
   <ul>
     <li><a href="index.html" class="selected">portfolio</a></li>
     <li><a href="about.html">about</a></li> 
     <li><a href="contact.html">contact</a></li>
   </ul>
 </nav> 
</header> 
mukul lohia
mukul lohia
985 Points

thanku sir you explain everything very well

sir when i was using untitled.html then why it was not working....

Marcin Lubke
Marcin Lubke
13,253 Points

It's simply because there's no "untitled.html" file in your project.

"href" attribute in <a> tag points to a file or address, where you will be taken after clicking this link. Your main project file is index.html, and that's where your links from "portfolio" and "logo" should point. If you set "href" to some file which aren't in your project, or internet address which isn't available or doesn't exist, you'll get an error.

mukul lohia
mukul lohia
985 Points

thanx sir for explaining these things