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

How to select the span element inside the .intro class in step 4 of the challenge on text size and style?

I am on the challenge for text size and style. I am having trouble figuring out how to select the span element inside intro. Does this happen on the style sheet or does something also need to change in the html sheet? On the CSS page, I have tried writing the span rule inside the .intro brackets, the first time as span { } and as <span> </span>. I have reviewed the videos multiple times and am not finding the answer.

2 Answers

Erik S.
Erik S.
9,789 Points

Hi Karen, you can add css selectors by just leaving a space in between.

.intro span {
  font-weight:bold;
  font-style:italic;
}

This will target the span element inside the paragraph with the intro class.

It only happens on the stylesheet and nothing needs to change on the html file. Think of everything outside the brackets as what needs to be targeted. What's inside the brackets is the styling you want to apply.

As Erik stated .intro space span will tell the browser that you want to select the intro class then look for the span element inside. From there, apply these attributes inbetween the curly brackets to that particular element.

Thanks, Eric, Nik, and Jeremy,

With your suggestions, I figured it out. I needed to know that things you pointed out about how to add the span element, then I realized I was having a reading comprehension issue, and needed to write a new rule with the .intro span {}, with font weight and style, below the .intro {}, with font size and line height.

Thanks again for the help, it was super useful!

Karen