Forum Moderators: not2easy

Message Too Old, No Replies

Using CSS in some parts of the layout?

using CSS with PHP

         

UltimateX

4:17 pm on Apr 5, 2005 (gmt 0)

10+ Year Member



Hi guys! I have a question. Is it possible to use CSS style sheets in only some parts of the layout? I have page that's composed of PHP. The header, footer, and the body of the layout all have seperate files which are included in one final page. What I wanna do is, use the CSS style sheet only in the body of the page, not in the header or the footer of the layout. This is because the header + the footer are created in Photoshop/ImageReady. They have tables and I don't want those tables to get messed up when trying to change the way they look in the body with a CSS style sheet. Is this possible? If so, then how?

Robin_reala

7:03 pm on Apr 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A simple(ish) way of doing this is to put a specific id on the body section of the page and then refer to all you CSS as subnodes of that id. For example, if you want all <span>s to be blue in:

<div id="body">
<p>Test <span>paragraph</span></p>
<img />
</div>

you could put in your CSS:

#body span { color: blue; }

UltimateX

7:47 pm on Apr 5, 2005 (gmt 0)

10+ Year Member



thanks

UltimateX

11:44 pm on Apr 5, 2005 (gmt 0)

10+ Year Member



thanks but that's not gonna work in this case cause I already setup the layout and there's an option in it which let's other users use their own "style" tags...what can i do to make it so that the header and the footer doesn't get affected by their code?