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

How to set background color in html

醉折花枝作酒筹
Release: 2023-01-05 16:08:25
Original
47770 people have browsed it

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>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template