Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS - handling different page layouts

Status
Not open for further replies.

multimed

Programmer
Dec 18, 2001
37
US
I found a really nice tutorial that helped get me up & running ( but I've run into a problem and I'm hoping for some help.

I have a layout I really like with two columns and it uses an external stylesheet. The problem is there are some pages on the site that I only want one column instead of two. Which is the recommended way to deal with this - create a separate stylesheet for the single-column pages and load that in, or keep the same external CSS, but use an internal one to override the external one where different.

Or is this just one of those things where it depends on a ton of other things.

Thanks for any help,
steve
 
2 options really

1. Simply link to a different stylsheet. Perhaps put common styles into a 'global' sheet then load the unique styles for each different layout. You can do this with another external stylesheet if you like, you can load as many as you like.

2. Add a class attribute to the body tag and reference different style rules by targetting elements based on that class. For example

Code:
body.homePage p {
    color:blue;
}

body.contentPage p {
    color:red;
}

That's just a taster, I'm sure you can modify it to suit your needs.

<honk>*:O)</honk>

Earl & Thompson Marketing - Marketing Agency Services in Gloucestershire
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top