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 trialSaul Casillas
3,566 PointsCan pass the code challenge on the adaptive layouts and media queries.
this is the original question hope someone can help me thanks.
Under "Tablets to Desktop," create a new media query that floats .logo left and .main-nav right if the viewport is 769px or wider. Then, add all other "Tablets to Desktop" rules inside the media query. Finally, create a new property inside the .extra rule that displays it as a block element.
13 Answers
Jeff Busch
19,287 PointsHi Saul,
All I can say is refresh the browser and try again. I tried your code and it works.
Jeff
/* Phones to Tablets */
@media only screen and (min-width: 481px) {
.col {
float: left;
}
.main {
width: 65.957446808511%;
}
.secondary {
width: 31.914893617021%;
}
.secondary,
.extra {
margin-left: 2.127659574468%;
}
}
/* Tablets to Desktop */
@media only screen and (min-width: 769px) {
.logo {
float: left;
}
.main-nav {
float: right;
}
.main {
width: 40.425531914894%;
}
.extra {
display: block;
width: 23.404255319149%;
}
}
@media only screen and (min-width: 1000px) {
.wrap {
width: 980px;
}
}
Jeff Busch
19,287 PointsSaul,
I don't know what to tell you. What browser are you using? I just passed all three challenge questions with the code below.
Jeff
@media only screen and (min-width: 481px) {
.col {
float: left;
}
.main {
width: 65.957446808511%;
}
.secondary {
width: 31.914893617021%;
}
.secondary,
.extra {
margin-left: 2.127659574468%;
}
}
/* Tablets to Desktop */
@media only screen and (min-width: 769px) {
.logo {
float: left;
}
.main-nav {
float: right;
}
.main {
width: 40.425531914894%;
}
.extra {
display: block;
width: 23.404255319149%;
}
}
@media only screen and (min-width: 1000px) {
.wrap {
width: 980px;
}
}
Saul Casillas
3,566 PointsHey thanks I tried on explorer chrome and fire fox and nothing, Firs i get the error that if I float the logo to the left I paste it as you wrote it too and nothing there might be a bug on the code challenge lol thanks for your help Jeff
marsha grasett
9,995 PointsIf you post your code here, that will help.
To format your code use the Markdown Cheatsheet (underneath the reply box here.)
Saul Casillas
3,566 Points@media only screen and (min-width: 769px) { .logo { float: left; } .main-nav { float: right; } .main { width: 40.425531914894%; } .extra { display: block; width: 23.404255319149%; } }
Saul Casillas
3,566 PointsThanks I tried i refresh it and nothing i rewrote the code like this and now i get this is error
Bummer! Be sure you're using a media query no narrower than 769px.
this is how i rewrote the code:
@media only screen and (min-width: 769px) {
} .main { width: 40.425531914894%; } .extra { display: block; width: 23.404255319149%; } }
.logo { float: left; } .main-nav { float: right; }
Saul Casillas
3,566 PointsThanks I tried i refresh it and nothing i rewrote the code like this and now i get this is error
Bummer! Be sure you're using a media query no narrower than 769px.
this is how i rewrote the code:
@media only screen and (min-width: 769px) {
} .main { width: 40.425531914894%; } .extra { display: block; width: 23.404255319149%; } }
.logo { float: left; } .main-nav { float: right; }
Jeff Busch
19,287 PointsSaul, your'e gonna kick yourself. Below is a portion of your code. I copied and pasted it. You closed your media query before any of the css.
@media only screen and (min-width: 769px) {
} <----- RIGHT HERE
Jeff
Saul Casillas
3,566 Pointsthanks I saw it but still i get the same error
"'@media only screen and (min-width: 769px) {
.main { width: 40.425531914894%; } .extra { display: block; width: 23.404255319149%; } }
.logo { float: left; } .main-nav { float: right; } '''
Saul Casillas
3,566 PointsHey Jeff I restarted my computer and that did it thanks for your help.
Saul Casillas
3,566 PointsHow do you make the code show it up in here i try to use it as the markdown sheet thanks once again.
Jeff Busch
19,287 PointsJohn Balladares
Courses Plus Student 9,828 PointsWeird - same thing that happened to Saul happened to me. Resetting my laptop did the job too.
jne
12,613 PointsSame happened to me now! Will try to restart my browser
Edit: my problem was that I didn't have space between "and" and "(min-width:769px)"