CSS Conditional comments
March 15th, 2009
Hi i am working hard in one new project but the first part of this project have nothing interesting using Flash – haaaaaaaa fuc** – and i expend so much time using and programming Actionscript and when i turn back to my begin, the XHTML, have some problems and one os this problems was using the drunk browser: Internet Explorer.
I think that nobody love IE, but if have one whatever. The fact is that IE is a most problem when use XHTML and it is one of thing that made me a Flash Programmer and not a XHTML Designer professional – hehehe.
Well, CSS and XHTML can work fine into Google Chrome, Mozilla Firefox, Opera, Safari but when you try test your project into the drunk browser you will see the problems:
• Wrong element position
• Wrong font-size
• Wrong list style, background position and so much more wrong things.
To resolve this problem, the first thing that you need is install Firefox, Safari, Opera or Chrome, ehehe, but if your client use Internet Explorer yet, well you will need make a custom style for your site: one work fine for all browser and one single for only resolve the problems of Internet Explorer.
In this case you will import one *.css file for all browsers and use the conditional comment to import a custom style for the Internet Explorer users. Hmmmm great no? To do it you need put this code into <head> tag:
<!--[if IE]><link to your custom style for IE<![endif]-->
You will see in your Dreamweaver, Aptana or other editor that your code will be commented but when you load the page on IE browser this *.css will be loaded and resolver your style problems, the problem is make the style two times but for XHTML sites is necessary.
You can too load files for especificly IE version using others codes like
<!--[if IE 5]>, <!--[if IE 5.5]>, <!--[if lte IE 5.5]>
and others, you can read more about it in bellow link.
http://www.quirksmode.org/css/condcom.html





March 15th, 2009 at 22:08
[...] » CSS Conditional comments | DES 84 – Blog of DES84 Website [...]
March 16th, 2009 at 01:28
wow thanks i think i need such tips. thanks
March 16th, 2009 at 09:03
@uwiuw: Really its a great solution.
April 15th, 2009 at 13:28
Hey, nice tips. I’ll buy a glass of beer to that man from that forum who told me to visit your blog
April 15th, 2009 at 13:41
Buy me a beer too. ehHEhe thanks and continue reading the blog
: )
April 21st, 2009 at 23:24
[...] to make other CSS file and import it with conditional only for IE like show my post about the CSS Conditional Comments, but searching and reading one more i saw one article that resolve my problem, use an IE7 Hack, [...]
January 24th, 2010 at 06:40
Useful views and useful contribution. I really enjoy piano a lot. I’ve marked it to revisit later. Imagination is more important than knowledge-Einstein
February 13th, 2010 at 17:06
This article is immensely informative and fruitful.It will help readers to take proactive decisions and update themselves accordingly. Thanks a lot for providing so valuable facts.