DEV Community

Cover image for HOW DO YOU CREATE A BACKGROUND COLOR IN HTML AND STYLE.CSS WHILE CODING?
mich-web
mich-web

Posted on

HOW DO YOU CREATE A BACKGROUND COLOR IN HTML AND STYLE.CSS WHILE CODING?

I have been trying to create a background color in my codes but it seems I don't get it.
The last time I tried it I did it like this:

In the HTML....
<body>
<bgcolor="#f1f132">
</body>

While in css....
.body {
bgcolor: #f1f132;
}
Enter fullscreen mode Exit fullscreen mode

PLEASE! can someone put me through?

Top comments (2)

Collapse
 
michweb profile image
mich-web

Thanks! But what about in styl.css?

Collapse
 
willtrout profile image
Matt Willtrout

<body style="background-color="#f1f132" >
</body>