Sunday, 17 July 2011

CSS bgcolor

CSS bgcolor

You may be familiar with the HTML bgcolor attribute. This attribute (which is now deprecated) allows you to set the background color of HTML elements such as the TABLE element or the BODY element.

Although there is no CSS bgcolor property or attribute, there is the CSS background-color property. background-color is the CSS equivalent to the HTML bgcolor attribute. Actually, the CSS background-color property is more powerful than the HTML bgcolor attribute - it can be applied to any element.

Example of Usage

 <style> body { background-color:#ff9900; } </style> 

Also see the CSS background property for setting all background properties of an element.

No comments:

Post a Comment