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 trialBrian Steed
8,215 PointsNest an element in CSS
I am trying to nest the span element inside the "intro." Unable to complete. Please advise.
<!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 {
font-size: 1.25em;
line-height: 1.6;
}
#intro "p span" {
font-weight: bold;
font-style: italic;
}
Nate Magera
1,475 PointsHello. You don't need to add the 'p' in the CSS code. Also the 'intro' class should have a period beforehand, not a #.
.intro span {
}
That should work.
2 Answers
Tom Ashton
7,720 PointsTry:
p.intro {
font-size: 1.25em;
line-height: 1.6;
}
p.intro span {
font-weight: bold;
font-style: italic;
}
Matthew Long
28,407 PointsYou don't need the p
tag and you don't need the double quotes. Also, intro
is a class not an ID, so keep it as .intro
instead of #intro
.
/* Complete the challenge by writing CSS below */
.intro {
font-size: 1.25em;
line-height: 1.6;
}
.intro span {
font-weight: bold;
font-style: italic;
}
a:link {
text-decoration: none;
}
steven swensen
7,926 Pointssteven swensen
7,926 Pointsso i don't see an 'intro' id, so i am assuming you are wanting to call your intro class the css should look like
Hope that helps.