Web Tools Table Maker3schools TranslateImage CompressorFavicon Icon GeneratorCrop & Resize Image
Apu
Apu October 24, 2022 › #color #Html

Write the HTML code to set the background color to yellow

To set the background color to an html element, we can use the css background-color property.

Syntax #

div{
 background-color:yellow;
}

We will use the style attribute to set background color of an element. The style attribute specifies an inline style for an element.

<div style="background-color:yellow">
  This is a block element.
</div>
save
listen
AI Answer
Write Your Answer
loading
back
View All