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
Bogdan Vlad
2,667 PointsStuck at Styling the Intro Paragraph Challenges.
I am currently stuck at the "Styling the Intro Paragraph" challenges, Task #4, to be more precise. It gives an error that says "Bummer! Make sure you're selecting the span element nested inside 'intro'. ", which I did. I’m sure that my code is correct, I’ve also used a text editor to check my code and it worked fine.
<!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>Lake Tahoe, California</h1>
</header>
<div class="primary-content t-border">
<p class="intro">
Lake Tahoe is one of the most <span class="p-span">breathtaking attractions</span> 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 href="#more">Find out more</a>
</div>
<footer class="main-footer">
<p>All rights reserved to the state of <a href="#">California</a>.</p>
<a href="#top">Back to top »</a>
</footer>
</body>
</html>
.intro {
font-size: 1.25em;
line-height: 1.6;
}
.p-span {
font-weight: bold;
font-style: italic;
}
1 Answer
Jennifer Nordell
Treehouse TeacherHi there! Your code would be correct except that the challenge is apparently checking which selector you're using. You've created a class it hasn't asked for. Note: it's important to try not to do things in these challenges that aren't explicitly asked for. Even if functional, it can cause the challenge to fail.
It's asking you to select the span within the intro class. We don't actually need to create a new class here (although you reasonably could outside of the challenge).
If I were to ask you to select the paragraph within a div with the class of "my-div", I would expect the selector to look like this:
.my-div p {
/* write your rules here */
}
This would select all paragraphs within any element containing the "my-div" class.
I think you can get it with these hints, but let me know if you're still stuck!
edited for additional tip
When posting a question to the forums, if the challenge isn't already linked, it's a good idea to include the link so that we can find it. I believe this challenge is the one you're referring to.
Bogdan Vlad
2,667 PointsBogdan Vlad
2,667 PointsHi Jennifer,
Thank you for your answer. I forgot about this way of selecting HTML elements. I passed the challenge :)
Have a great day