This forum is now read-only. Please use our new forums! Go to forums
divs background colour width and height
I’m having trouble on: Selecting HTML Elements Course written by Eric Weinstein
- 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
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
Answer 50c05ab9d55843e754001575
i do this way but i learned apart from this course
into index.html i added
into stylesheet.css i added .myDiv{ background-color: #cc0000; height:100px; width:100px; }
and it works
note the point before myDiv{
1 comments
Answer 523d4500548c35f849001d72
Answer 546dc7be631fe9fa7a001420
div { background-color: #cc0000; height:100px; width: 100px; }
That all and it works ;) Fabrice
Answer 529acbf8548c352a720113af
Answer 52de26138c1ccc03df002e07
Answer 508eb36e36cb53020000410b
7 comments
I got the red square like you were supposed too. this is copyand pasted code.
thanks but it still doesn’t work - it still says I don’t have the right background color :/
nevermind fixed it :)
I am having the same problem. I copy and pasted but it is still not working. Not sure what I’m missing here.
u test
put
in the html not the css…Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency
1 comments
Thankyou!!!!!