This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by Nicole
over 11 years

divs background colour width and height

I’m having trouble on: Selecting HTML Elements Course written by Eric Weinstein

  1. Background color, height, and width

I’ve written the code but it says “error on line 2: undefined - Oops, try again. It looks like your

doesn’t have the right background-color (#cc0000)!”

my code:

div style=”background-color: #cc0000; width: 100px; height: 100px;”>

except the div tag at the beginning has the opening arrow (wouldn’t let me post with it).

Answer 52011b06548c35d1b2004f36

2 votes

Permalink

I just put this is my CSS:

Div{ background-color: #cc0000; height:100px; width:100px; }

points
Submitted by Defect
over 10 years

1 comments

CodingCat about 9 years

Thankyou!!!!!

Answer 50c05ab9d55843e754001575

1 vote

Permalink

i do this way but i learned apart from this course

into index.html i added

myDiv

into stylesheet.css i added .myDiv{ background-color: #cc0000; height:100px; width:100px; }

and it works

note the point before myDiv{

points
Submitted by andabe
over 11 years

1 comments

jeryymanly about 10 years

how to specify color in css

http://www.corelangs.com/css/text/csscolor.html

manly

Answer 523d4500548c35f849001d72

1 vote

Permalink

div{background-color: #cc0000,height:100px,width:100px;}

also working

points
Submitted by Dstar
over 10 years

Answer 546dc7be631fe9fa7a001420

1 vote

Permalink

div { background-color: #cc0000; height:100px; width: 100px; }

That all and it works ;) Fabrice

points
over 9 years

Answer 529acbf8548c352a720113af

0 votes

Permalink

dic{
background-color:#cc0000; width:100px; hight:100px; } For some reason the above let me into the next lesson, but not

div{
background-color:#cc0000; width:100px; hight:100px; }

HUMMM

points
Submitted by Bonnie
over 10 years

Answer 52de26138c1ccc03df002e07

0 votes

Permalink

Start your response…

points
Submitted by jeryymanly
about 10 years

Answer 508eb36e36cb53020000410b

-2 votes

Permalink

it should look like this:

points
Submitted by Trevor Liss
over 11 years

7 comments

Trevor Liss over 11 years

I got the red square like you were supposed too. this is copyand pasted code.

Nicole over 11 years

thanks but it still doesn’t work - it still says I don’t have the right background color :/

Nicole over 11 years

nevermind fixed it :)

sparrow_marie over 11 years

I am having the same problem. I copy and pasted but it is still not working. Not sure what I’m missing here.

We Oll over 11 years
We Oll over 11 years

u test

Thao Phan about 11 years

put

in the html not the css…