![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
Can't have it both ways, that is, you can't define two instances of BODY. Only one BODY to a page. |
|
If you want a plain background, then you have to ditch the background image. While you're at it, ditch one of the BODY style declarations. |
#12
| |||
| |||
|
|
The method you are using is highly redundant. Why would the body tag need a class and a general statement? |
#13
| |||
| |||
|
|
When I declare on HTML page LINK href="mycss.css" type="text/css" rel=stylesheet / ... BODY class=myclass in mycss.css BODY { FONT-WEIGHT: bold; FONT-SIZE: 12px; FONT-FAMILY: Arial, Geneva; background-image: url(images/back.jpg); } BODY.myclass { FONT-WEIGHT: bold; FONT-SIZE: 15px; FONT-FAMILY: Arial, Geneva; background-color: #777777; } ... the background-color in the second declaration is NOT taken but the "normal" background image back.jpg is used for the background. How do I get #777777 as background-color ? |
#14
| |||||
| |||||
|
|
When I declare on HTML page LINK href="mycss.css" type="text/css" rel=stylesheet / |
|
BODY class=myclass |
|
in mycss.css BODY { FONT-WEIGHT: bold; FONT-SIZE: 12px; FONT-FAMILY: Arial, Geneva; background-image: url(images/back.jpg); } |
|
BODY.myclass { FONT-WEIGHT: bold; FONT-SIZE: 15px; FONT-FAMILY: Arial, Geneva; background-color: #777777; } |

|
the background-color in the second declaration is NOT taken but the "normal" background image back.jpg is used for the background. How do I get #777777 as background-color ? |
#15
| |||
| |||
|
|
BODY { FONT-WEIGHT: bold; FONT-SIZE: 12px; FONT-FAMILY: Arial, Geneva; background-image: url(images/back.jpg); } BODY.myclass { FONT-WEIGHT: bold; FONT-SIZE: 15px; FONT-FAMILY: Arial, Geneva; background-color: #777777; } ... the background-color in the second declaration is NOT taken but the "normal" background image back.jpg is used for the background. How do I get #777777 as background-color ? |
#16
| |||
| |||
|
|
When I declare on HTML page LINK href="mycss.css" type="text/css" rel=stylesheet / ... BODY class=myclass in mycss.css BODY { FONT-WEIGHT: bold; FONT-SIZE: 12px; FONT-FAMILY: Arial, Geneva; background-image: url(images/back.jpg); } BODY.myclass { FONT-WEIGHT: bold; FONT-SIZE: 15px; FONT-FAMILY: Arial, Geneva; background-color: #777777; } ... the background-color in the second declaration is NOT taken but the "normal" background image back.jpg is used for the background. How do I get #777777 as background-color ? |
#17
| |||
| |||
|
|
In our last episode, ceo3f6$l3j$01$1 (AT) news (DOT) t-online.com>, the lovely and talented Kevin Yu broadcast on comp.infosystems.www.authoring.html: When I declare on HTML page LINK href="mycss.css" type="text/css" rel=stylesheet / ... BODY class=myclass in mycss.css BODY { FONT-WEIGHT: bold; FONT-SIZE: 12px; FONT-FAMILY: Arial, Geneva; background-image: url(images/back.jpg); } BODY.myclass { FONT-WEIGHT: bold; FONT-SIZE: 15px; FONT-FAMILY: Arial, Geneva; background-color: #777777; } ... the background-color in the second declaration is NOT taken but the "normal" background image back.jpg is used for the background. How do I get #777777 as background-color ? I could be wrong, but it appears to me that BODY.myclass is inheriting background-image from BODY so that BODY.myclass gets background-color plus background-image, and of course the background-image covers the color. |
#18
| |||
| |||
|
|
I could be wrong, but it appears to me that BODY.myclass is inheriting background-image from BODY so that BODY.myclass gets background-color plus background-image, and of course the background-image covers the color. Though this looks like inheritance, there is no inheritance in CSS. |
|
The BODY selector and the BODY.myclass selector both match the BODY tag, so both apply following the usual cascade rules, |
#19
| |||
| |||
|
|
"Harlan Messinger" <h.messinger (AT) comcast (DOT) net> wrote: I could be wrong, but it appears to me that BODY.myclass is inheriting background-image from BODY so that BODY.myclass gets background-color plus background-image, and of course the background-image covers the color. Though this looks like inheritance, there is no inheritance in CSS. There is. But probably you mean that there is no inheritance involved in _this_ phenomenon, and that's correct: The BODY selector and the BODY.myclass selector both match the BODY tag, so both apply following the usual cascade rules, Indeed. But children of BODY may, by certain rules, inherit properties from BODY, and so on. |
#20
| |||
| |||
|
|
When I declare on HTML page LINK href="mycss.css" type="text/css" rel=stylesheet / ... BODY class=myclass in mycss.css BODY { FONT-WEIGHT: bold; FONT-SIZE: 12px; FONT-FAMILY: Arial, Geneva; background-image: url(images/back.jpg); } BODY.myclass { FONT-WEIGHT: bold; FONT-SIZE: 15px; FONT-FAMILY: Arial, Geneva; background-color: #777777; } ... the background-color in the second declaration is NOT taken but the "normal" background image back.jpg is used for the background. How do I get #777777 as background-color ? |
![]() |
| Thread Tools | |
| Display Modes | |
| |