How To Set Background Color In HTML? - Tutorialspoint
Có thể bạn quan tâm
Setting the background color of a web page or an element on the web page, enable us to create unique layouts for the web page.
To set the background color in HTML, use the style attribute, with the CSS property background-color inside the body tag of the HTML document.
HTML5 do not support the <body> tag bgcolor attribute, so the CSS style is used to add background color. The bgcolor attribute deprecated in HTML5.
We can change the background color by overriding the property with the other property.
Syntax
<body style="background-color:aquamarine;">Example
Following is the example program to set background color in HTML.
<!DOCTYPE html> <html> <body style="background-color:aquamarine;"> <h1>HTML Articles</h1> </body> </html>We can change the background color by overriding the property with the other color.
Example
Following is the example program to set background color in HTML.
<!DOCTYPE html> <html> <body style="background-color:khaki;"> <h1>HTML Articles</h1> </body> </html>We can specify the background color with RGB value. RGB value indicates its red, green, and blue color intensity. Each intensity value is on a scale of 0 to 255, or in hexadecimal from 00 to FF.
Example
Following is the example program to set background color with RGB value.
<!DOCTYPE html> <html> <head> <style> body { background-color: rgb(20,30, 1); } </style> <h1>HTML Articles</h1> </head> <body> </body> </html> Lokesh Badavath Updated on: 29-Aug-2023238K+ Views
Từ khóa » Html Bgcolor Rgb
-
HTML Colors - W3Schools
-
HTML Background Color - HTML Color Codes
-
HTML Color Codes
-
HTML - Bgcolor - Tizag Tutorials
-
CSS: Background-color Property - TechOnTheNet
-
How To Add & Change Background Color In HTML - HubSpot Blog
-
HTML Color Codes And Names - Computer Hope
-
Background-color - CSS: Cascading Style Sheets - MDN Web Docs
-
Change HTML Background Color Or Font Color - BitDegree
-
HTML Bgcolor Attribute - GeeksforGeeks
-
HTML Color Codes - Dofactory
-
Yellow Color Codes
-
Red Color Code - HTML RGB Red Color
-
Web Colors - Wikipedia