• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 173
  • Last Modified:

IE hacks in One Stylesheet

Hello,

I was wondering if anyone knew if it possible to use IE hacks in one stylesheet.
We have tried but they don't work. The below example does not work.

. menu li {
background-color:red;
}
<!--[if IE 7]>
. menu li {
background-color:yellow;
}
<![endif]-->

I need to do something like this because we are building a Website Template builder that shares one page with a CSS stylesheet changing the entire look.
0
MLSLI
Asked:
MLSLI
2 Solutions
 
Dave BaldwinFixer of ProblemsCommented:
No, CSS doesn't understand the IE conditionals, they work just in the HTML.
0
 
MLSLIAuthor Commented:
DaveBaldwin:

Is there a way round this like:

<!important>

or any other inline hacks
0
 
Dave BaldwinFixer of ProblemsCommented:
The normal way is to provide alternate stylesheets in the HTML using the IE conditional statements.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
nanharbisonCommented:
0
 
Bob StoneIT GuruCommented:
You can put java script into CSS files using expressions

Like this makes browsers that don't normally support max-width do so with a bit of script

See -
http://gadgetopia.com/post/2774
http://webfx.eae.net/dhtml/cssexpr/cssexpr.html

There are some that detest css expressions, but if it works best for a particular application, then so be it.
p
{
max-width:800px;
width:expression(document.body.clientWidth > 800? "800px": "auto" );
}

Open in new window

0
 
jmorasCommented:
See the source code in a browser of www.toys-shop.gr we have implemented what you ask ..
0
 
GaryCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now