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 trialLiliana Leyva
3,711 PointsWhy my 2nd @media query is not working? when I view the site the h1 (word California) goes down to the P.
here is my code:
@media (max-width: 1024px) {
.primary-content,
.secondary-content {
width: 90%;
}
}
@media (max-width: 760px){
.primary-content,
.secondary-content {
width: 100%;
padding: 20px;
border: none;
}
.main-header{
max-height: 380px;
padding: 50px 25px 0;
}
.title {
font-size: 1.3rem;
border: none;
}
h1 {
font-size: 5rem;
line-height: 1.1;
}
.arrow {
display: none;
}
}
8 Answers
DavidPaul sullivan
17,377 PointsYour media queries should always go on the bottom of your CSS :)
Liliana Leyva
3,711 PointsI guess was just a setting that I have on Chrome :)
DavidPaul sullivan
17,377 PointsGlad ya got it working! Sometimes I even have issues with cookies and workspaces. Good luck on your next section!
DavidPaul sullivan
17,377 PointsMmmm, maybe I mis understood the question. My bad. It actually looks like your code is fine, can you upload a screen shot or maybe even your html? I even ran my old workspace and compared and used your code and everything was fine.
Liliana Leyva
3,711 PointsWas just a setting that I had on the browser :).. Thank you
Caitlin Dudley
3,866 PointsI think I'm having the same issues over here. My second media query isn't responding on my browser. Anyway someone could share what that Chrome setting was? I tried to play around with Device Mode in Devtools but didn't really get anywhere. This is my media query section and it's at the bottom of my CSS style sheet.
@media (max-width: 1024px) {
.primary-content,
.secondary-content {
width: 90%;
}
.wildlife {
padding: 10% 12%;
margin: 50px 0 20px;
}
}
@media (max-wdith: 768px) {
.primary-content,
.secondary-content {
width: 100%;
padding: 20px;
border: none;
}
.main-header {
max-height: 380px;
padding: 50px 25px 0;
}
.title {
font-size: 1.3rem;
border: none;
}
h1 {
font-size: 5rem;
line-height: 1.1;
}
.arrow {
display: none;
}
.intro {
font-size: 1rem;
}
}
DavidPaul sullivan
17,377 Pointstry flipping your media queries (so 768px first then 1024px) I know it sounds weird but thats worked for me in the past.
Caitlin Dudley
3,866 PointsMeh, that didn't work for me.
DavidPaul sullivan
17,377 Pointsand it works fine in other browsers?
DavidPaul sullivan
17,377 PointsAlso try using min-width for your first query
@media (min-wdith: 768px) {
.primary-content,
.secondary-content {
width: 100%;
padding: 20px;
border: none;
}
Caitlin Dudley
3,866 PointsI think there may be something wrong with my code. I tried a different chrome profile and firefox as well as moved the max-width: 1024px media query down below and switching to min-width: 768px but nothing happens.
DavidPaul sullivan
17,377 PointsFace Palm. Sorry I just saw it. Your second media query is spelled "wdith" fix that typo and you'll be golden
Caitlin Dudley
3,866 PointsGeez, face palm indeed, it worked! Thank you!
DavidPaul sullivan
17,377 PointsIt's all good! I do this alll the time, sometimes I just gotta slow down and read EVERYTHING lol. Good luck!
Nathan Angulo
4,565 PointsWhat am I doing wrong. Everything is wonky and sizing awkwardly.
Liliana Leyva
3,711 PointsLiliana Leyva
3,711 PointsI put them at the bottom, I don't know what I did wrong :S