Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-01-29 16:42:28

sparksmemphis
Member
From: Memphis TN
Registered: 2008-01-23
Posts: 10
Website

Target IE with CSS?

How do i target different versions of IE with my css?
I dont like hacks and i want to use conditional comments or something of that nature but when i add the conditional comment with the css rule inside it nothing changes.

having some problems with a margin in IE per usual. groans
wish everybody was on firefox…


www.digitalskraps.com

Offline

#2 2008-01-29 17:15:02

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: Target IE with CSS?

box model hack might be of help.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2008-01-29 22:20:38

robin746
Member
From: Ireland
Registered: 2007-09-22
Posts: 113
Website

Re: Target IE with CSS?

Unless you need to specifically target version 5 and earlier browsers (very little need in year 2008) you can do everything with conditional comments. They are safe and do work. If they are not working for you I recommend trying out simple test pages and seeing what is wrong with your code.

The box model and other hacks should not be used since they uglify your code, make maintenance difficult, encourage errors and might trigger unknown side-effects in browsers you are not testing with. As new browsers (like IE7) are introduced you will have to revisit all your old code to fix newfound incompatibilities. This is a nightmare.

If you practice “safe styling” you should not have to put much CSS in a separate IE CSS file… but there are always cases where some helps.


robin

Offline

#4 2008-01-30 04:24:25

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Target IE with CSS?

Double-check the URL of the IE-specific CSS and ensure it’s being loaded last.

Offline

Board footer

Powered by FluxBB