Home > Article > Web Front-end > How to add background color to the entire page in css
How to add a background color to the entire page in css: You can use the background-color attribute to add a background color, such as [background-color:yellow;]. The background-color property is used to set the background color of an element.
The background-color property sets the background color of an element.
The background of an element is the total size of the element, including padding and borders (but not margins).
(Learning video tutorial: css video tutorial)
Attribute value:
color Specifies the background color.
transparent Specifies that the background color should be transparent. This is the default
inherit specifies the background color, which should be inherited from the parent element
Example:
body { background-color:yellow; } h1 { background-color:#00ff00; } p { background-color:rgb(255,0,255); }
Related Recommended: CSS tutorial
The above is the detailed content of How to add background color to the entire page in css. For more information, please follow other related articles on the PHP Chinese website!