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

My html files dont switch back and forth properly

Yes when I look at the html file online, when I first load the page it looks fine. But then when I switch to 'contact' page it looks fine also. But then if I try to switch back to 'music' page which I believe to the code is the first index.html file, the screen loses it center and background color and properly padding margin etc...could anyone tell me why this is happening? here is the code below for the html file for music page :

<DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Bijan Fardjad | Music / Video Game Artist </title> <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="css/main.css">

</head> <body> <header> <a href="index.html" id="logo"> <h1>Bijan Fardjad</h1> <h2>Video Game / Music Artist</h2> </a> <nav> <ul id="pages">

     <li><a href="index.html">Music</a></li>
     <li><a href="contact.html">Contact</a></li>
     <li><a href="gameCode.html">Game Code</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>This is a picture</p>
          </a>
      </li>
         <li>
        <a href="img/numbers-06.jpg">
        <img src="img/numbers-09.jpg" alt="">
          </a>
      </li>
         <li>
        <a href="img/numbers-02.jpg">
        <img src="img/numbers-01.jpg" alt="">
          </a>
      </li>

      </ul>
    <p>Gallery will go here</p>
    </section>
    <footer>

      <a href="https://twitter.com/DudeBjonShadow"><img src="img/twitter-wrap.png" alt="Twitter"></a>
  <a href="https://www.facebook.com/bijan.fardjad.3"><img src="img/facebook-wrap.png" alt="Facebook"></a>

       <p>&copy; 2015 Bijan Fardjad</p>
    </footer>
  </div>
 </body>

</html>

and this is the code for the second contact page html :

<DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Bijan Fardjad | Music / Video Game Artist </title> <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="css/main.css">

</head> <body> <header> <a href="index.html" id="logo"> <h1>Bijan Fardjad</h1> <h2>Video Game / Music Artist</h2> </a> <nav> <ul id="pages">

     <li><a href="index.html">Music</a></li>
     <li><a href="contact.html">Contact</a></li>
     <li><a href="gameCode.html">Game Code</a></li>
     </ul>


   </nav>
   </header>
  <div id="wrapper">
    <section>

    </section>
    <footer>

      <a href="https://twitter.com/DudeBjonShadow"><img src="img/twitter-wrap.png" alt="Twitter"></a>
  <a href="https://www.facebook.com/bijan.fardjad.3"><img src="img/facebook-wrap.png" alt="Facebook"></a>

       <p>&copy; 2015 Bijan Fardjad</p>
    </footer>
  </div>
 </body>

</html>

I know this is a lot of code to look through but if anyone knows what is up with these codes if you could let me know that would be great, Bijan

3 Answers

are you opening the ul tag or not ? under the logo a elemente, .i dont see the <ul> opening

Wow you're awesome...but it still doesn't make sense, if when I re-click the link to go to music page, it doesn't show the page as before. So my wondering is if it doesn't show the same images and set-up when re-clicking because the code is like i showed, then why does it even run the music page set-up the correct way the 1st time. Like why does it work the first time but then re-clicking on it produces a different result. Wouldn't it just from the 1st time produce the result that happens when i re-click? Sorry if you don't get this, but your help worked, thank you very much. Bijan

hey, you welcome, is because, at first, the browser is only loading the html as it is, but when you click the anchor tag, you re asking a link to be rendered and if the structure it belongs to isnt valid, it may contain some surprises :).

hey thanks alot..."you welcome" ha, anyway damn grammar...thanks for your help...and I think i figured it out about the actual science behind why it doesn't work, so if the tag is not opened it's not reading that code, so it basically only reads the remaining code that is readable so you have blocks of stuff not being the same as before...i guess...but i see that if the code is not accessible its weird because the link is not accessible not having an opening tag so i guess it shouldnt read anything so when i click it shouldnt go anywhere, but i know i ask too many questions...but thanks for your help....Bijan

i mess up on grammar too at times maybe too much for one this comment part section showed with a highlight or underline that "alot" was not correct but i didnt change it anyway, take care, Bijan