Internet Explorer (IE) or CSS Conditional Statements

Internet Explorer conditional statement or CSS Conditional statements is a bit of code specially made for Internet Explorer browers which instructs ie browser to perform specific instructions only for internet explorer browser, only windows platform supports ie conditional statements.

the basic structure or syntax of conditional statements is just..like plain HTML comments so therefore you can only use it inside an html file..

here are some examples of Internet Explorer Conditional Statement syntax

<!--[if IE 6]>
enter your instructions for ie6 here
<![endif]-->
<!--[if gte IE 5]>
enter your instructions for ie browers greater than or equal to ie5
<![endif]-->
<!--[if lte IE 6]>
enter your instructions for ie browsers lower or equal to ie6
<![endif]-->
<!--[if lt IE 6]>
enter your instructions for ie browsers lower than ie6
<![endif]-->
<!--[if gt IE 6]>
enter your instructions for ie6 here
<![endif]-->

this is very usefull for example if you want to separate a css file for different different versions
of internet explorer you can use this, or if you want to output messages to your site visitor telling
them that they are using ie. here are some examples

Using conditional statement to separate css stylesheet

<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="ie7.css">
<![endif]-->

Using Conditional statement to output text to the browser

<!--[if IE 6]>
Hi There! You are using Internet Explorer 6
<![endif]-->
<!--[if IE 5]>
Hi there! You are a legend your still using IE5?
<![endif]-->

Enjoy :)

Share and Bookmark this Post..

  • Digg
  • Yahoo! Buzz
  • Twitter
  • Facebook
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks
  • Technorati
  • Reddit
  • Sphinn
  • MySpace
  • Slashdot
  • BlinkList
  • Live
  • Mixx
  • NewsVine
  • Yahoo! Bookmarks
  • Ratimarks
  • LinkedIn





Tags: , , ,

13 Responses to “Internet Explorer (IE) or CSS Conditional Statements”













Leave a Reply

This blog will make your link do follow after you leave 5 comments. i check every comment posted and reply to each also. please do not spam i hate spam, there is no room for spam here in my blog thanks!

CommentLuv Enabled
:argh: :| :$ :B :cool: :*( :curious: x_x :gasp: =D :happy: :/ :D :injured: :lol: :lol2: :love: :X :meh: O_o :ohhyeahh: D: :omg: :raisebrow: :P :( 0_0 :shocked: :sly: :) :] ;] :worry: :wow:

Subscribe to feed

this blog use Comment Luv

Featured Post


Make your Wordpress URL Search Engine Friendly
Simple steps to make your wordpress url search engine friendly..


Give some luv with comment luv
This blog is now comment luv powered..


Fix Wordpress PHP fatal error memory size exhauster
Ways on how to solve PHP fatal error or PHP memory limit on wordpress blogs anr other opensource web apps..


Download Norton Antivirus Internet Security for free
Read this post to know how you can download a free norton antivirus or internet security..


Sponsored Links


 1 User Online