2 replies [Last post]
jdpayne
jdpayne's picture
Offline
newbie
Last seen: 12 years 18 weeks ago
Timezone: GMT-6
Joined: 2010-01-15
Posts: 1
Points: 2

I'm having an issue with Internet Explorer (who doesn't?). The site I'm working on is built using a lot of CSS3, which IE obviously doesn't support. I've worked around most of the issues and am now working on "the little things" to get the site design in IE to look as close to it's Safari/Firefox/Chrome counterparts as possible. The particular thing I'm working on at the moment is rounded corners. Since IE doesn't render this property, I am trying to use an IE-specific stylesheet to add a transparent .png as the background image for some of my div containers, basically just using images to create the effect of rounded corners. My problem is that IE is not reading my conditional stylesheet AT ALL. It has absolutely no affect on the page.

Here is the code I'm using to link to the stylesheet:

<!--[ if IE]>
<link rel="stylesheet" href="ie_css.css" type="text/css" media="all" />
<![endif]-->

And here is the conditional stylesheet:

.nav ul li {
	background-color:#000;
	position:relative;
}
.nav ul li:hover {
	background:url(images/nav_li_current_ie.jpg);
	position:relative;
}
.nav ul li.current {
	background:url(images/nav_li_bg_current.jpg);
	position:relative;
}
.sidebar {
	background:#fff url(images/sidebar_ie.jpg);
	position:relative;
}

It is my understanding that IE should read this stylesheet, and override the background properties in my normal stylesheet and replace it with these background properties. I had read somewhere that often times float properties (which I'm using quite extensively in my current stylesheet, including these div classes) can cause problems with background images in IE. I'm not changing the HTML on the page itself. Is there something I'm missing or a better way to go about this? Thanks!

flamenco
flamenco's picture
Offline
Enthusiast
US, East Coast
Last seen: 11 years 18 weeks ago
US, East Coast
Timezone: GMT-5
Joined: 2009-04-13
Posts: 240
Points: 144

Hi, I can't give a good

Hi,
I can't give a good opinion without a link, which would show contrast between regular and IE CSS. I will, however, offer a thought.

If you have other CSS appearing after your "conditional IE CSS", it can easily override your IE code, just like with any CSS. The last CSS has the final word, so to speak. You may have already thought of this and put IE code last, in which case I have no idea.

Good luck. D

Smee
Smee's picture
Offline
Elder
Adelaide, Oz
Last seen: 4 years 47 weeks ago
Adelaide, Oz
Timezone: GMT+9.5
Joined: 2007-06-10
Posts: 1596
Points: 340

Unless ie_css.css is in the

Unless ie_css.css is in the root directory, it won't find it. Check your path. On the server.

Mods and gurus – THANK YOU!
For your time, knowledge and experience so willingly and generously given.
Please come back tomorrow and sort us all out again Smile