This forum is now read-only. Please use our new forums at discuss.codecademy.com.

CSS: An Overview Forum

View Course » View Exercise

169 points
E4df4050d6d068d423dcd4d8cfd96a79?s=140&d=retro
Submitted by
jadew67
about 4 years ago

CSS: Selectors (ID Error) Please Help

Step one reads "Give the h2 header an ID of "intro".
So I did that writing:

<div id="intro">
    <h2>Introduction</h2>
</div>    

I am now receiving an error reading: Oops, try again! Did you remember to add the intro ID to the h2 header?

Isn't that what I did? What am I not seeing?

This is the full code:

<!DOCTYPE html>
<html>
    <head>
        <link type="text/css" rel="stylesheet" href="stylesheet.css"/>
        <title>Result</title>
    </head>
    <body>
        <div id="intro">
        <h2>Introduction</h2>
        </div>


        <div class="standout">
        <h3>Classes and IDs in CSS</h3>
        <p>Classes and IDs are super easy in CSS. You're using them right now!</p>
        </div>

        <h3>Regular HTML Selectors</h3>
        <p>If you don't bother with a class or ID, an HTML element just gets
           the regular CSS styling for that element—or the default styling if you
           don't specify any particular styling on the stylesheet.
        </p>
    </body>
</html>

0 votes

permalink

Try removing the DIV wrapper on the H2:

<h2 id="intro">Introduction</h2>

8298 points
5958b8ebe12813a2a3000034_980106998
Submitted by
Roy
about 4 years ago