Mastering HTML and CSS: From Fundamentals to Advanced Techniques
How to use the bgcolor attribute in HTML?
Introduction
In HTML, the bgcolor attribute sets the background color of a HTML element. The bgcolor attribute can be used with the HTML tags like
<body>, <table>, <marquee>, <td>, <tr>, <th>.
SYNTAX
· tag - you can use any HTML tag like <body> , <p>, <button>, etc.
· rgb/hex/color_name - These are attribute values, there are different ways to use colors but can use only one at a time.
ATTRIBUTES
EXAMPLES:
Set the bg color of the body to blue.
OUTPUT:
HTML bgcolor Attribute by specifying the text as blue & background as pink color
OUTPUT:
Using bgcolor with table
write your code here: Coding Playground
OUTPUT