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

General Discussion

Mike Capewell
Mike Capewell
4,501 Points

Smells Like Bakin' - Parse Error on Media Query

Hi Guys,

I'm working through the build a responsive website project and keeping getting a parse error on the small resolution media query coded as part of the style CSS - anyone else had this error?

Direct check of the code works fine?

Cheers

Mike

4 Answers

Guil Hernandez
STAFF
Guil Hernandez
Treehouse Teacher

Hey Mike Capewell,

It looks like you're missing one of the closing curly braces in:

     ...
     ul.nav li.contact {
    width: 30%;
    background: #4fb69f;
    padding: 1% 0%;
    border-radius: 10%;
    text-align: center;

}

It needs to be:

     ...
     ul.nav li.contact {
    width: 30%;
    background: #4fb69f;
    padding: 1% 0%;
    border-radius: 10%;
    text-align: center;
  } 
   }
Mike Capewell
Mike Capewell
4,501 Points

Hi Guil,

Thanks for your help - are you sure? I've tried the adjustment and still get the error plus another one saying there is an extra "}".

There are elements adjusted as part of the media query after the ul.nav li. contact so the last curly bracket is at the end:

 /*media queries-----Small_Res*/


 @media screen and (max-width: 650px) {
.grid_1, 
.grid_2,
.grid_3,
.grid_4,
.grid_5,
.grid_6,
.grid_7,
.grid_8,
.grid_9,
.grid_10, 
.grid_11, 
.grid_12 { width: 100%;}

#logo {
    text-align: center;
 }

 ul.nav li {
    float: left;
    margin: 5% 0%;
 }

 ul.nav li.about {
    width: 20%;
    text-align: center;
 }

 ul.nav li.locations {
    width: 30%;
    text-align: center;
 }

 ul.nav li.pricing {
    width:50%;
    text-align: center;
 }

 ul.nav li.contact {
    width: 100%;
    background: #4fb69f;
    padding: 3% 0%;
    border-radius: 20%;
    text-align: center;
}

#intro-img {
    display: none;
}

#featured-cupcake, #new-cupcakes{
    margin:5% 0;
}
#featured-cupcake img{
    max-width: 95%;
}

}
Guil Hernandez
STAFF
Guil Hernandez
Treehouse Teacher

Mike Capewell

The issue is in your @media screen and (max-width: 1024px) media query. You need to close this media query block before you begin the next one.

Mike Capewell
Mike Capewell
4,501 Points

Thanks Guil - stupid error by me!

Mike