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 trialWilliam Chestnut II
1,453 Points@media query font size
Can someone assist me with this question .. I believe that I have it right but it's wont take what I put in. Thanks!
/* Complete the challenge by writing CSS below */
@media (max-width: 1020px) {
.main-header {
background: tomato;
color: white;
}
}
@media (max-width: 768px) {
.title: {
font-size: 1.4rem;
}
h1 {
font-size: 5rem;
}
}
<!DOCTYPE html>
<html>
<head>
<title>Lake Tahoe</title>
<link rel="stylesheet" href="page.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<header id="top" class="main-header">
<span class="title">Journey Through the Sierra Nevada Mountains</span>
<h1 class="main-heading">Lake Tahoe, California</h1>
</header>
<div class="primary-content">
<p class="intro">
Lake Tahoe is one of the most breathtaking attractions located in California. It's home to a number of ski resorts, summer outdoor recreation, and tourist attractions. Snow and skiing are a significant part of the area's reputation.
</p>
<a class="callout" href="#more">Find out more</a>
</div><!-- End .primary-content -->
</body>
</html>
5 Answers
Daniel Barros
Front End Web Development Techdegree Graduate 23,589 PointsHi William,
I tried the exact same code you reproduced in your question and got a pass in the challenge. I also tested both your files in Codepen and the media queries work as expected.
You may find an issue with the challenge window viewer though, as it's relatively small and it seems it will not reach the minimum 768px for the narrower media query to kick in.
I hope this info is of assistance. :)
Just send a reply if you're still having issues with it and I'm happy to assist. Cheers,
Daniel
KRIS NIKOLAISEN
54,971 PointsYou have a colon after .title that shouldn't be there
Osher Zalman
1,281 Pointsim not passing either. my code:
```css
/* Complete the challenge by writing CSS below */
@media (max-width: 1020px) { .main-header { background-color: tomato; color: white; }
@media (max-width: 768px) { .title { font-size: 1.4rem; } h1 { font-size: 5rem; } } ```
Rachel Campbell
12,957 PointsI'm having the same issue (without the colon after .title)..
@media (max-width: 1020px) {
.main-header {
background-color: tomato;
color: white;
}
@media (max-width: 768px) {
.title {
font-size: 1.4rem;
}
h1 {
font-size: 5rem;
}
}
}
keeps telling me I didn't set the correct font size for .title but the instructions do say 1.4 rem
KRIS NIKOLAISEN
54,971 PointsRachel - You are missing a closing bracket for your first media query.
Rachel Campbell
12,957 PointsAh, thank you so much Kris! I was so frustrated trying to figure out what was going on in the second section that I completely overlooked that. /facepalm. Thank you!