html tutorial - bgcolor Attribute in HTML - html5 - html code - html form




Bgcolor attribute in html

Learn html - html tutorial - Bgcolor attribute in html - html examples - html programs

  • The bgcolor is used to set the background color.
  • Hence it does not support in HTML5 version.

Syntax for bgcolor attribute in HTML:

<element bgcolor=”value”>

Differences between HTML 4.01 and HTML5 for bgcolor attribute:

HTML 4.01

  • HTML4 support bgcolor attribute.

HTML5

  • HTML5 does not support bgcolor attribute.

Applies to:

Elements Attribute
<body> bgcolor
<table> bgcolor
<tr> bgcolor
<td> bgcolor

Attribute values for bgcolor attribute:

Value Description
color_name Specifies the background color with a color name (like "red")
hex_number Specifies the background color with a hex code (like "#ff0000")
rgb_number Specifies the background color with an rgb code (like "rgb(255,0,0)")

Sample coding for bgcolor attribute in HTML:

Tryit<!DOCTYPE html>
<html>
    <body bgcolor="sky blue">
        <h1>Welcome to Wikitechy!</h1>
        <p>
            <a href="http://www.wikitechy.com">Visit Wikitechy.com!</a>
        </p>
    </body>
</html>

Code Explanation for bgcolor attribute in HTML:

bgcolor Attribute Code Explanation

  1. The bgcolor attribute is used to set the background color for the body of the HTML document.

Output for bgcolor attribute in HTML:

bgcolor Attribute Output

  1. The output shows the skyblue color as a background color of the HTML document.

Browser Support for bgcolor attribute in HTML:

Yes Yes Yes Yes Yes

Related Searches to bgcolor Attribute in html

Adblocker detected! Please consider reading this notice.

We've detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.

We don't have any banner, Flash, animation, obnoxious sound, or popup ad. We do not implement these annoying types of ads!

We need money to operate the site, and almost all of it comes from our online advertising.

Please add wikitechy.com to your ad blocking whitelist or disable your adblocking software.

×