PDA

View Full Version : two stylesheets or two styles?



intcon
Oct 4th, 2009, 10:50 PM
My client wants her website to be part black background and white text, and part with a white background and black text. =)
is it easier to make 2 different style sheets and link the black ones to black.css and white to white.css?
or write two different styles like bodyblack for one and bodywhite for the other with their matching hyperlinks and toss it all into one css file?

carrie

Excavator
Oct 4th, 2009, 11:07 PM
Hello again intcon,
This is a perfect example of how CSS can really simplify things for you.
Try adding an id to your CSS file, something like this:
body {
font: normal 10px Arial, Helvetica, sans-serif;
color: #000000;
background: #FFFFFF center top;
margin: 0px;
text-align:center; /* for IE */
}
#white_on_black {
font: normal 10px Arial, Helvetica, sans-serif;
color: #fff;
background: #000 center top;
margin: 0px;
text-align:center; /* for IE */
}
#wrapper {
padding: 0px;
border:0;
width: 800px;
margin:0px auto;
text-align: left;
background-image:url('vine2.jpg');
background-repeat:no-repeat;
background-attachment:scroll;
background-position:center right;
}
Then in the markup, on the pages you want to flop the colors, make this change in red:
<link href="jordan.css" rel="stylesheet" type="text/css" />
</head>

<body id="white_on_black">

<div id="wrapper">
<table width="800" bo

intcon
Oct 4th, 2009, 11:22 PM
sweet....thanks millions!
and one more question....=) in my wrapper I use a graphic for the background, but will need to use a different one for the white background pages....how would i code that in?
and yes, I fully realize I'm being a pest :D

lol

carrie

Excavator
Oct 4th, 2009, 11:31 PM
Hmm, you could try something like this:
body #white_on_black #wrapper {
} for one
and body #wrapper {
} for the other.
I'm not sure that would be specific enough though. Give it a try and see.

intcon
Oct 5th, 2009, 12:05 AM
ok..all systems are go....thanks for all your help excavator.. and cleaning up my CSS as we speak!

carrie

Excavator
Oct 5th, 2009, 12:07 AM
No problem intcon. Glad to be of some help!