?
Solved

IE hacks in One Stylesheet

Posted on 2010-09-10
8
Medium Priority
?
160 Views
Last Modified: 2013-09-01
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
Comment
Question by:MLSLI
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 33648932
No, CSS doesn't understand the IE conditionals, they work just in the HTML.
0
 

Author Comment

by:MLSLI
ID: 33649080
DaveBaldwin:

Is there a way round this like:

<!important>

or any other inline hacks
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 252 total points
ID: 33649465
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!

 
LVL 17

Assisted Solution

by:nanharbison
nanharbison earned 248 total points
ID: 33649817
0
 
LVL 9

Expert Comment

by:Bob Stone
ID: 33653663
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
 

Expert Comment

by:jmoras
ID: 38920989
See the source code in a browser of www.toys-shop.gr we have implemented what you ask ..
0
 
LVL 58

Expert Comment

by:Gary
ID: 39456028
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
Suggested Courses
Course of the Month13 days, 13 hours left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question