Éric Vesque wrote:

>> <div> dark blue background image gradient.
>> <h1> on top of it, styled white to be readable</h1>
>> </div>
- -
> Just add:
>
> background-color: (whatever color you want);
>
> to the properties of your div; this should do it.

It's safer to set the properties for the h1 element, e.g.

h1 { color: #006; background: #fff; }

If you only set background for the enclosing div, then most of the time the 
h1 will have a transparent background and things will be OK. But why take 
chances when there is nothing to be won? Some day the page might be viewed 
in a situation where some other style sheet affects it, too, possibly a user 
style sheet, and that style sheet might set a background color, and even a 
background image (that's why my example sets background and not just 
background-image), and who knows what they might be?

Generally, always set color and background together.


Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/ 

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to