Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't css work with this div?

Tags:

html

css

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.

like image 231
WinterDev Avatar asked May 18 '26 02:05

WinterDev


1 Answers

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

like image 82
APAD1 Avatar answered May 20 '26 01:05

APAD1