Brian Cummiskey wrote:
> I think I mis-wrote what i really have for markup.
>
> lets try some ascii:
Generally, a URL tells more than fragments of code and ASCII illustrations
together.
>> -DIV WRAP gradient, 150px tall begins....--------------|
>> ---------margin and filler space--------------------------|
>> ---------h1, approx 18px line height, color:white;--------|
>> ---------gradient, 150px tall continues...-----------------|
>> ---------margin and filler space--------------------------|
>> ---------gradient ends ----------------------------------|
>> -/DIV WRAP-------------------------------------------|
It would seem natural to use just a <h1> element instead, with a suitable
background color (which won't be used when the background image is available
and the browser is configured to use it), background image, text color, and
paddings. Are there some special reasons not to use this simple scenario,
which avoids the problem?
> If I set the h1 to have a bg color, such as the #006 suggested to
> match the dark blue, then it stands out and blocks the gradient.
> Effectively, i need a transparent background on the h1 when images are
> on, but a #006 when images are off.
You can't make the background color dependent on whether images are on or
off, because CSS lacks such programming features. (Using client-side
scripting, it might be possible, but that's unreliable and off-topic.)
So if have special reasons to wrap <h1> inside <div> and set background
color for the latter, then you would need to set the background of <h1> to
transparent (which is the initial value, but setting it to transparent is
still different from not setting it at all). In principle, this is
unreliable, since another style sheet (such as a user style sheet) could
set, say, color: #006; background: white for the <div>, making your heading
text appear white on white. The risk would be small, though, since such
another style sheet would be somewhat odd, if it just sets <div> background
and color without setting <h1> background and color.
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/