Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Expertise: Intermediate
Nov 18, 1998



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Setting Layer/DIV Background Colors

Often it is desirable to set a background color for an entire layer or DIV region, much like setting the background color for a whole table. Setting a layer background color should work the same for version 4 of both Netscape and Internet Explorer but it doesn't. The Cascading Style Sheet (CSS) background-color:color sets the background color in Internet Explorer, but only colors the background of text in Netscape 4. To get the same effect in both browsers, use two tags in sequence: background-color:color for Internet Explorer and layer-background-color:color for Netscape. For example:
<div id="photolayer" style="z-index: 1; left: 5px; top: 50px; width: 530px; 
height: 370px; background-color:#003366; layer-background-color:#003366; visibility: visible"> 
Erik Goetze
Thanks for your registration, follow us on our social networks to keep up-to-date