Below are some examples of applying background color to a table in HTML. Set background color randomly - HTML Free Code You can use that attribute in two basic ways - through the Cascading Style Sheets (CSS) or by setting background properties in the HTML elements directly. Get Free HTML codes and scripts. A full list of color names can be found at W3 Schools - Colors. Demo/Code. Making a Background Color Transparent One thing I didn't introduce while discussing background colors is the value of TRansparent for the background-color property. Now to implement this, we have defined 9 different colors and to display them randomly, we have used using the Math.random(). Color contrast ratio is determined by comparing the luminosity of the text and background color values. CSS background-color property used with 6 digits hexadecimal color code; CSS background-colorproperty combined with RGB color code; 3 Digit Hexadecimal Color Codes. In HTML, table background color is defined using Cascading Style Sheets (CSS). This page contains HTML code for coloring an element green. Returns. HTML Background Color Example include HTML Background Color Codes, HTML Div Section Background Color Code Examples. Defining HTML Colors. Example body { background-color:blue; } .highlightme { background-color:#FFFF00; } p { background-color:#FFFFFF; } In the CSS code above, there are three elements being defined. It is important to ensure that the contrast ratio between the background color and the color of the text placed over it is high enough that people experiencing low vision conditions will be able to read the content of the page. However, this attribute has been deprecated in favor or using CSS to style tables.The attribute does still work in most browsers and can accept color names, hex color …