Disable CSS on Certain Pages (Full Version)

All Forums >> [Web Development] >> Cascading Style Sheets



Message


Mick Dugan -> Disable CSS on Certain Pages (3/10/2007 8:26:28)

Hi All,

I'm using CSS to display my logo on the top of each page, but there are some pages where I'd prefer not to display it at all. Is there a way to do this, or is this an "all or nothing" situation?




jurgen -> RE: Disable CSS on Certain Pages (3/10/2007 9:26:39)

You could split your style sheet and make 2 css files. One "main.css" and one "logo.css". When you want to show the logo just link both files in your header. Otherwise leave it out.




Tailslide -> RE: Disable CSS on Certain Pages (3/10/2007 10:29:01)

Might be easier to give your logo a class such as "noshow" on the pages you don't want it seen on then add a rule to the stylesheet:

img.noshow {display:none;}


If you remove the stylesheet from the page all together you'll lose the rules for the rest of the page.




Donkey -> RE: Disable CSS on Certain Pages (3/11/2007 20:29:11)

My first reaction is why not just leave it out of the html on those pages? If it is not in the html but is called in as a background image to the body or a container div then just take Helana's "noshow" idea and create a
body#noshow
without the background image and for the pages where you don't want the logo in the html replace <body> with <body id="noshow">




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.03125