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

CSS CSS Basics (2014) Understanding Values and Units Styling the Intro Paragraph

Create CSS rule

Create a new rule that targets the span element inside .intro. Give the span element a bold font weight and an italic font style.

span.intro { font: bold italic; font-size: 12.5em; } I think the problem is with the selector portion of the code, can anyone help me?

index.html
<!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 intro">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 &raquo;</a>
    </footer>
  </body>
</html>
style.css
/* Complete the challenge by writing CSS below */
span.intro {
  font: bold italic;
  font-size: 1.25em;
}

3 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! You're doing really well, but you're trying to target something that doesn't exist. Your code targets the span that has the class "intro". In HTML the thing you would be targeting would look something like this:

<p>Here's some text. <span class="intro"> And here's some more! </span></p>

But it's asking you to target the span inside the class "intro".

<div class="intro">
    <span> Even more text! </span>
</div>

This one targets the first:

span.intro {

}

This one targets the second:

.intro span {

}

Hope this helps! :sparkles:

I'm sorry. I do not understand your answer at all. Is the problem with the index.html or with style.css or both? I tried moving the tag span after .intro, that is .intro span { } but it still doesn't work.

I'm sorry. I do not understand your answer at all. Is the problem with the index.html or with style.css or both? I tried moving the tag span after .intro, that is .intro span { } but it still doesn't work.

Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! Sorry it took so long to get back to you, but time zones are likely different. The problem is with your style. First and foremost, it seems you removed the style that was targeting the "intro" class from steps 2 and 3. These challenges are cumulative.

Step 4 asks you to add a new rule that targets the span inside of the "intro" class. To pass step 4 you will need two rules and the should follow essentially this format:

.intro {
  /* Make the font-size 1.25 em */
  /* Make the line-height 1.6 (unitless) */
}

.intro span {  /* This line targets the span inside of intro as opposed to a span that has been assigned the class intro */
  /* make the font weight bold */
  /* make the font style italic */
}

Hope this helps! :sparkles:

Manjila Nakarmi
Manjila Nakarmi
7,449 Points

The easiest way to do it would be to just have .title and the styles inside the curly braces. you don't need a span selector or intro class if its too confusing. since the span has two classes intro and title and the title class doesn't repeat again in the index.html you should be fine with it.