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

Stephen Roberts
Stephen Roberts
8,580 Points

selecting the nav element in CSS responsive page?

Hello I have been having issues with selecting the nav element in my CSS responsive page. I am following Nick's tutorial and as far as I can see I have followed completely however when using the mediaquery techniques it won't allow me to select the nav element? always highlighted in red. Here is a copy of my code.

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

/****************************
Two column layout
*****************************/

#primary { width: 50%; float: left; } #secondary { width: 40%; float: right; }

  /****************************
Page: Portfolio
*****************************/

#gallery li { width: 28.3333%; }

#gallery li:nth-child(3n + 1) { clear: left; }

/**************************** Page: About *****************************/

.profile-photo { float: left; margin: 0 5% 80px 0; }

}

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

/****************************
Header
*****************************/

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

}

I would be grateful if someone could tell me what I'm doing wrong.

Regards Steve

1 Answer

Stephen Roberts
Stephen Roberts
8,580 Points

Sorry ignore this post I have just resolved it. Realised I had spelt @mediaquery rather than @media . Haha rookie mistake