WinterDev
WinterDev

Reputation: 358

Why doesn't css work with this div?

So I have a body here:

 <body>
 <div id=”first”>
    <span class=”red”>This is a DIV Container</span>

    Or
    <br>
    This
</div>

And I have a style sheet with this

#first{
    background-color:red;
}

But the background color doesn't change. I have no idea what I'm doing wrong...

Here's a jsfiddle with the code

https://jsfiddle.net/fuz5uqfb/

Doesn't worth there either.

Upvotes: 3

Views: 57

Answers (1)

APAD1
APAD1

Reputation: 13666

You're using the wrong kind of quotation marks for your div id and span class. It should be this:

<body>
    <div id="first">
        <span class="red">This is a DIV Container</span>

        Or
        <br>
        This
    </div>
</body>

Updated Fiddle

Upvotes: 5

Related Questions