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 trialAllan Woo
4,311 PointsCannot create a new rule to target span inside .intro
I am asked to create a new rule to target the span element inside .intro, but I am completely lost
<!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>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>
/* Complete the challenge by writing CSS below */
.intro span {
font-size: 1.25em;
line-height: 1.6;
font-weight: bold;
font-style: italic;
}
1 Answer
Jason Anders
Treehouse Moderator 145,860 PointsHi Allan, Although your code is correct in syntax, you are combining styles that you shouldn't be.
The first 2 questions in the challenge want you to style the .intro class, with font-size and line-height.
The next 2 question are for the span inside the .intro class, so you need to create a whole new selector. By the end of task#4 you will have 2 separate selectors, each with two style attributes:
.intro {
font-size: 1.25em;
line-height: 1.6;
}
.intro span {
font-weight: bold;
font-style: italic;
}
Hope that makes sense. Jason :)
Allan Woo
4,311 PointsAllan Woo
4,311 PointsWow, thanks for that, it had me stumped for ages
Jason Anders
Treehouse Moderator 145,860 PointsJason Anders
Treehouse Moderator 145,860 PointsNo worries!
If an answer solves your problem, it's a good idea to select that answer as "Best Answer" as this lets others in the forum know you question was answered.
Happy Coding Allan! :)