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

CSS How to Make a Website Responsive Web Design and Testing Adjust the Profile Page and Header

Audrey Barker
Audrey Barker
2,963 Points

Nav Elements aren't reacting

My workspace doesn't seem to be reacting to the code I put in, and I can't find the problem.

Here is the code for the header in main.css

header {
  float: left;
  margin: 0 0 30px 0;
  padding: 5px 0 0 0;
  width: 100%;
}

#logo {
  text-align: center;
  margin: 0;
}

Here is the code in the responsive.css

@media screen and (min-width: 660px) {

   /*******************
    HEADER
   ********************/

   nav {
    background: none;
    float: right;
    font-size: 1.125em;
    margin-right: 5%;
    text-align: right;
    width: 45%; 
  }

  #logo {
    float: left;
    margin-left: 5%;
    text-align: left;
    width: 45%;

  }

}
Wayne Priestley
Wayne Priestley
19,579 Points

Hi Audrey,

Can you post your html please.
Also, do you mean the code is not doing what your expecting after you add the styles to your nav?

Audrey Barker
Audrey Barker
2,963 Points

Hi Wayne,

I mean that none of the things like removal of the background, floating the nav elements to left, etc. are happening.

here is my html

html>
  <head>
    <meta charset="utf-8">
    <title>Audrey Barker | Designer </title>
    <link rel="stylesheet" href="css/normalize.css">
    <link href='http://fonts.googleapis.com/css?family=Changa+One|Open+Sans:400italic,700italic,400,700,800' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" href="css/main.css">
    <link rel="stylesheet" href="css/responsive.css">
  </head>
  <body>
     <header>
       <a href="index.html" id="logo">
        <h1>Jess Barker Document Research & Retrieval, LLC.</h1>
        <h2>Your Nationwide Title Company</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>

1 Answer

Ismael Uriarte
Ismael Uriarte
10,403 Points

Your html tag is missing the less-than sign.