"; the color value can be Represented as a hexadecimal number, RGB value or color name."/> "; the color value can be Represented as a hexadecimal number, RGB value or color name.">

Home >Web Front-end >HTML Tutorial >How to set background color in html

How to set background color in html

醉折花枝作酒筹
醉折花枝作酒筹Original
2021-04-14 17:34:0247772browse

In HTML, you can set the background color by writing the "background-color" attribute inside the tag, the syntax is ""; where the color value can be represented by a hexadecimal number, RGB value or color name.

The operating environment of this tutorial: Windows7 system, CSS3&&HTML5 version, Dell G3 computer.

Set the background color of an h2 tag to red

<h2 style="background-color:red;">这是一个标题</h2>

How to set background color in html

##Set the background color of the body to yellow

How to set background color in html

Set the background color of a paragraph to green

How to set background color in html

Set the background color of a div to gray

How to set background color in html

Recommended learning:

html video tutorial

The above is the detailed content of How to set background color in html. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn