Search results
In HTML, a color can be specified by using a color name: Tomato. Orange. DodgerBlue. MediumSeaGreen. Gray. SlateBlue. Violet. LightGray. Try it Yourself » HTML supports 140 standard color names. Background Color. You can set the background color for HTML elements: Hello World.
- HTML Elements
Large collection of code snippets for HTML, CSS and...
- HTML Comments
Color Picker. Use our color picker to find different RGB,...
- HTML Styles
Large collection of code snippets for HTML, CSS and...
- HTML Tables
W3Schools offers free online tutorials, references and...
- HEX
HEX Color Values. In HTML, a color can be specified using a...
- HSL
HSL Color Values. In HTML, a color can be specified using...
- CSS Backgrounds
In these chapters, you will learn about the following CSS...
- CSS background-color property
The background-color property sets the background color of...
- HTML Elements
In these chapters, you will learn about the following CSS background properties: background-color; background-image; background-repeat; background-attachment; background-position; background (shorthand property)
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 border (but not the margin). Tip: Use a background color and a text color that makes the text easy to read.
You can set a background color for an HTML document by adding style="background-color:" to the <body> element. Example of setting a background color with the style attribute:
The W3Schools online code editor allows you to edit code and view the result in your browser
12 wrz 2022 · In this article, you have learned how to change the background color of HTML element’s using the CSS background-color property. You also learned how developers did it before the introduction of HTML5 with the bgcolor attribute.
Make colorful website backgrounds with ease. Learn how to add an HTML background color using Hex color codes, HTML color names, RGB and HSL color values.