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 Pixels and Percentages

Kelly Strosser
Kelly Strosser
3,173 Points

They want me to increase the font size of the class title to 26px, why is this code wrong?

The code challenge is not accepting this as the correct answer and I cannot figure out what it could otherwise be. No previous value has been set.

style.css
/* Complete the challenge by writing CSS below */
#title {
  font-size: 26px;
}
index.html
<!DOCTYPE html>
<html>
  <head>
    <title>Lake Tahoe</title>
    <link rel="stylesheet" href="page.css">
    <link rel="stylesheet" href="style.css">
  </head>
  <body>
    <div class="container">
      <header>
        <span class="title">Journey through the Sierra Nevada Mountains</span>
        <h1>Lake Tahoe, California</h1>
      </header>
      <div class="main-content">
        <p>
          Lake Tahoe is one of the most breathtaking attractions 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="#">Find out more</a>
        <h2>Check out all the Wildlife</h2>
        <p>
          As spawning season approaches, the fish acquire a humpback and protuberant jaw. After spawning, they die and their carcasses provide a feast for gatherings of mink, bears, and Bald eagles.
        </p>
        <a href="#">See the Wildlife</a>
      </div>
    </div>
  </body>
</html>
Samuel Canerday
Samuel Canerday
12,610 Points

In the CSS you are using #title. The # character in CSS as a selector looks for an ID. For a class selector use .title instead.

2 Answers

Hi Kelly!

In your CSS selector for 'title' you are using the hash symbol (#) which is used for selecting CSS ID's. However, in this case you are looking to select a class which can be achieved by using a period.

So, if you set your code to be the following it should all work fine:

.title {
    font-size: 26px;
}
Kenneth Steward
Kenneth Steward
5,087 Points

This isn't an answer...

I stumbled upon this because I was having a similar problem.

but this is what I entered:

'''css .title{ font-size: 26px; } '''