Background color, please help!


#1

I dont undestand what is wrong.


<!DOCTYPE html>
<html>
    <head>
        <title>Sexy background color!</title>
    </head>
    <body style="background: brown";>
        <h3>Favorite Football Teams</h3>
            <ol style="background: yellow";>
                <li>The Hawthorn Football Club</li>    
                <li>San Franscisco 49ers</li>
                <li>Barcelona FC</li>
            </ol>            
    </body>
</html>


#2

First of all, you are wrong at the style attribute.
You typed background but, background what?
background size? color? look at the example you have there and check what is wrong with your code

Plus, you need the semi-colons before the quote mark like:

<ol style="STYLE-ATTRIBUTE: yellow;">

or you can type it with no semi-colons at all like:

<ol style="STYLE-ATTRIBUTE: yellow">

#3

Background actually does work, it is just a shorthand so that you don't have to specify what type of background you want to use.

Just thought that you might want to know this as it may save you time with writing css in the future :slight_smile:


#4

Before i answered this thread, i tried to type just background and it didnt work.
plus, i never heard or saw from the lessons that i can use this shorthand because there's no such thing


#5

You can go create a new code bit or use a text editor to try it out :slight_smile: There are lots of things that the lessons don't teach, because there is a lot of stuff to learn about it.

I would suggest expanding your learning in html and css to other websites as well. There is one very good YouTube channel named TheNewBoston that will help with that :slight_smile:


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.