You are here: Re: Question in regards to a defining a css class « HTML « IT news, forums, messages
Re: Question in regards to a defining a css class

Posted by nice.guy.nige on 10/25/98 11:43

While the city slept, BK (jerem43@att.net) feverishly typed...

> I am trying to get my webpage fully dependant on the CSS for layout. I
> have several pages on my site. Here is the layout:
[...]
> 3. The backgrounds are all laid out with an inline style in the head
> of each page like this:
>
> <style type="text/css">
> <!--
> body { background-image: url("backgrounds/greengrey.jpg")}
> -->
> </style>

Get rid of this... keep it in your css file.

> My question is this, is it permissable to define a class in the css
> for the individual page groupings.
>
[...]
> body.red { background-image: url("backgrounds/redrey.jpg")}
[...]

Yes. You can define a background for each section of your site as such. In
the HTML for each such page, use <body class="red"> (etc)

I would, however, not recommend using terms such as "red", "green", "blue"
to define your pages. What happens when you decide that the contact page
should be yellow instead of orange? And the Links page should be blue
instead of yellow??? You are entering a "World Of Pain[tm]" by defining your
css code by presentation. Instead, define them by section as follows;

body.links {
background-image: url("backgrounds/bluegrey.jpg");
}

body.contact {
background-image: url("backgrounds/yellowgrey.jpg");
}

Hope that helps,
Nige

--
Nigel Moss http://www.nigenet.org.uk
Mail address will bounce. nigel@DOG.nigenet.org.uk | Take the DOG. out!
"Your mother ate my dog!", "Not all of him!"

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация