![]() | |
![]() |
| | Thread Tools | Display Modes |
#21
| |||
| |||
|
|
Ben C schrieb: On 2009-07-21, shapper <mdmoura (AT) gmail (DOT) com> wrote: 1. The color warnings. Does this mean I always need to set a background color even if transparent? There is a small risk of a user stylesheet intervening and changing your transparent to white. But I wouldn't really worry about that. It would be quite strange for a user to have a stylesheet that set white backgrounds on things and not color, unless they were trying to make text invisible. Consider the following. author stylesheet: body { color: #000; background: #fff } div#content { color: #000; background: transparent } user stylesheet: body { color: #fff; background: #000 } result: body { /* user stylesheet wins */ color: #fff; background: #000 } div#content { /* from author stylesheet */ color: #000; background: transparent /* #000 (from user stylesheet) */ } |
#22
| |||
| |||
|
|
Yes, that could happen, but perhaps the real lesson here is: don't use background: transparent unless you're fairly sure you've also set the background of whatever's behind (and of whatever's behind that if it's transparent). |
|
But there is always some degree of risk whatever you do-- the user can always override either the background or the text colour but not necessarily both, even if you always set background and color in the same rule. |
![]() |
| Thread Tools | |
| Display Modes | |
| |