Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Conditional css files?

Is there any way to do this? I have to types of pages, one with a side bar and one without. They are identical except for the presence of the side bar.

Right now I'm just using two different css files. Is there any way to use the same one? Is there anyway to send some variable to the css file and have some kind of conditional statement?

Update:

It has nothing to do with browsers. You didn't read my post. Some pages have a side bar and some don't with changes what I need in the CSS file.

2 Answers

Relevance
  • Anonymous
    1 decade ago
    Favorite Answer

    If you are using two different pages which are dependent on browser type, you can use a browser sniffer script to steer the right CSS file to the browser. If it is just for IE browsers, you can use IE's Conditional Comments to select and use the right CSS file.

    Otherwise, you might have to use a server side script to set conditions and CSS to be used for those conditions met or not met.

    Ron

  • 1 decade ago

    No conditional css files

    No variables in css

    but u can use important keyword to override rules

Still have questions? Get your answers by asking now.