how to specify different css for ie


Tags: css,internet-explorer,cross-browser

Problem :

I need to include different .css files for IE anf all other browsers.

I tried the following but it doesn't work.

<!--[if !IE]><!-->
<link type="text/css" rel="stylesheet" href="css/my_style.css">
<!--<![end if]-->
<!--[if IE]><!-->
<link type="text/css" rel="stylesheet" href="css/my_style_IE.css">
<!--<![end if]-->


Solution :

You can give css path this way for IE condition.

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

You can get better help from below link.

http://www.quirksmode.org/css/condcom.html

Enajoy...!! :)


    CSS Howto..

    Show just cursor (caret) but hide the letters in input

    CSS animations - How to toggle direction with one keyframes declaration

    Force browsers load CSS before showing the page

    How to use CSS to make this works on retina screen?

    How to change css file of bx-slider, multiple sliders on a page [closed]

    How to style a div to be a responsive square? [duplicate]

    How to combine two css3 gradients ?

    How can i make my paragraph go to the next line after a certain width

    how to make those two divs in one line

    How to create the + button with CSS?

    Third level drop down css wont show & content/links are out of order?

    How to add a class if div height reaches a fixed height?

    how to make background 100% on a top menu

    How can I convince Firefox to redraw CSS Pseudo-elements?

    CSS - How to make rectangle with pointed sides? [duplicate]

    How do you make a nav bar “sticky”?

    How to reset jQuery toggled classes applied throughout the page? (AngularProject)

    How to change the opacity background color of other two buttons once we click on a single button using css

    How do I automatically resize an image for a mobile site?

    How to pause a Spinkit animation?

    Cant figure out how to apply css to menus in my footer

    Why IE10 shows something totally different

    How to clear the parent css

    How do I align text to the middle of an element with CSS in Twitter Bootstrap?

    how to change a css background onclick

    CSS: How to specify table's height such that a vertical scroll bar appears?

    How can I base one CSS setting on another?

    How to properly make my own list-style?

    How to change the font-size of the part of textarea text in HTML,CSS?

    how to achieve following using css ( digits input )