HighDots Forums  

background-color: #777777 not working in CSS

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss background-color: #777777 not working in CSS in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #21  
Old   
JayB
 
Posts: n/a

Default Re: background-color: #777777 not working in CSS - 08-03-2004 , 03:58 PM







"Kevin Yu" <kyu_alpha (AT) lycos (DOT) net> wrote

Quote:
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 ?
BODY.myclass {FONT-WEIGHT: bold; FONT-SIZE: 15px; FONT-FAMILY: Arial,
Geneva; background-color: #777777; background-image: none;}

--
JayB




Reply With Quote
  #22  
Old   
JayB
 
Posts: n/a

Default Re: background-color: #777777 not working in CSS - 08-03-2004 , 04:02 PM






Sorry for the redundant reply. I saw this post in alt.html but replies were
set to only go to comp.infosystems.www.authoring.stylesheets. Perhaps if the
OP set the replies to go to all the groups this message was sent to the
responses would be a little more organized.

--
JayB



Reply With Quote
  #23  
Old   
lime
 
Posts: n/a

Default Re: background-color: #777777 not working in CSS - 08-03-2004 , 07:41 PM



Quote:
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 ?

Probably b/c BODY over-rides BODY.myclass. You have 2 things competing for
the 1 BODY tag.

I'd say an alternative would be to change the 1st BODY class to read
something like BODY.anotherclass and where you don't want a page to display
class=myclass you change it to class=anotherclass

EG:

BODY.anotherclass { 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; }




Reply With Quote
  #24  
Old   
rf
 
Posts: n/a

Default Re: background-color: #777777 not working in CSS - 08-04-2004 , 02:53 AM



Kevin Yu wrote:

Quote:
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; }

Quote:
the background-color in the second declaration is NOT taken
Yes it is. However you also have a background-image. This is being used as
well.

Quote:
but the "normal" background image back.jpg is used for the background.
Yes.

Quote:
How do I get #777777 as background-color ?
Specify background-image: none;

--
Cheers
Richard.




Reply With Quote
  #25  
Old   
Philipp Lenssen
 
Posts: n/a

Default Re: background-color: #777777 not working in CSS - 08-05-2004 , 03:27 AM



Kevin Yu wrote:

Quote:
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 ?

Kevin
Where's the URL? Did you validate your HTML? I can't seem to figure out
if you're using XHTML or HTML. Also, you should get some of the case
straight (you mix a lot). Good luck with the problem. Note that
font-size: 12px is a bit dangerous for certain pixels -- much better to
use relative scaling, but use the default (no definition) for the main
body.

--
Google Blogoscoped
http://blog.outer-court.com


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.