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 Responsive Web Design and Testing Adjust the Profile Page and Header

Elena Paraschiv
Elena Paraschiv
9,938 Points

error: navigation comes above the logo

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

    /*******************************************************
        ABOUT
    *******************************************************/
    #prime {
        width:50%;
        float:left;
    }
    #second {
        width:50%;
        float:right;
    }
    .par{
        width:100%;
        float:center;

    }


}




@media screen and (min-width: 640px){
/*******************************************************
    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%;
}
h1 {
    font-size:2.5em;
    margin-bottom:20px;
}

    /*******************************************************
        HOME PAGE
    *******************************************************/
    /*to make 3 columns
        3 *  2*2.5%(each element has a 2.5% margin on both sides *2)=15
        100-15=85%/3 (for all 3 images) =28.33333%
    */
    #gallery li {
        width:28.3333%;
    }





}

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

    }

}
Elena Paraschiv
Elena Paraschiv
9,938 Points
main.css
/*******************************************************
GENERAL
*******************************************************/
body {
font-family: 'Simonetta', cursive;
}

#wrapper {
    text-align:center;
    max-width:940px;
    margin:0 auto;
    padding:0 5%;

}

a {
    text-decoration: none;
}

li{
    list-style-type: none;
}


img{
    max-width:100%;
}

h3{
    margin: 0 0 1em 0;
}



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


#logo{
    text-align:center;
    text-decoration:none;
    font-family: 'Kanit', sans-serif;
}

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

}


/*******************************************************
NAVIGATION
*******************************************************/

nav {
    text-align:center;
    font-family: 'Simonetta', cursive;
}

nav ul{
    list-style:none;
    margin: 0 10px;
    padding:0;
}

nav li {
    display:inline-block;
}

nav a {
    font-weight:bold;
    padding:15px 10px;
}



/*******************************************************
FOOTER
*******************************************************/

footer {
    text-align:center;
    clear:both;
    padding-top:50px;
    color:#ccc;
}

.social-icon{
        width:30px;
    height:30px;
    margin:0px 5px;

}
footer p {
    font-size: 12px;
}
/*******************************************************
PAGE PORTFOLIO
*******************************************************/

#gallery{

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

#gallery li{
    float:left;
    width:45%;
    margin:2.5%;
    background-color:#f5f5f5;

}
#gallery li a p {
    margin:0;
    padding:5%;
    font-size:0.75em;
    color:#867979;
}


/* glitch:bring footer center_indexpage*/


/*******************************************************
PAGE: ABOUT
*******************************************************/

.profile-photo {
    display:block;
    max-width:150px;
    margin:0 auto 30px;
    border-radius:100px;
}



/*******************************************************
GET INVOLVED
*******************************************************/


form h1,h2 {
    color:black;
}
fieldset {
    width:100%;

    margin:auto;
}


/*******************************************************
COLORS
*******************************************************/
body {
    background-color:#fff;
    color: #999;
}

header {
    background:#808080;
}
nav{
    background:#867979;
}
h1, nav a{
    color:#fff;

}



/* selected nav link */
nav a.selected, nav a:hover {
  color: #32673f;
}
Elena Paraschiv
Elena Paraschiv
9,938 Points

It looks like this. Imgur How can I make the nav look beneath the logo as in the video?

Hi Elena,

Can you post a snapshot of your workspace?

https://teamtreehouse.com/forum/workspace-snapshots

2 Answers

rdaniels
rdaniels
27,258 Points

I had the same problem as you following how Nick did it. I changed mine with relative settings, so that in large screens it is at the bottom, but then as the screen gets smaller it raises to the middle and then for small screens it is under the logo... This is how my nav section is (I kind of like the effect!)...

nav {
    background: none;
    float: right;
    font-size: 1em;
    margin-top: 8%;
    margin-right: 5%;
    text-align: right;
    width: 45%;
  }
rdaniels
rdaniels
27,258 Points

In your index.html is your nav section located above your h1 tag in the header? If it is you'll want to put it right below your closing "a" tag.

Elena Paraschiv
Elena Paraschiv
9,938 Points

no. its underneath the h1 tag.

<header>

    <a href="index.html" id="logo">
        <h1>Code_Africa</h1>
        <h3>'Change their future, one code at a time'</h3>
    </a>

    <nav>
        <ul>
            <li><a href="index.html" class="selected" >Home</a></li>
            <li><a href="about.html">About</a></li>
            <li><a href="involved.html">Get Involved</a></li>
        </ul>
    </nav>
</header>