dcsimg
www.webdeveloper.com
Results 1 to 7 of 7

Thread: stylesheet only for ie 10

Hybrid View

  1. #1
    Join Date
    Apr 2013
    Posts
    36

    stylesheet only for ie 10

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


    not working in ie 10


    is another way ?

  2. #2
    Join Date
    Apr 2013
    Posts
    36
    #hh2{ this work in google chrome
    font-family: Myriad Pro;
    font-size: 22px;
    color: #656565;
    padding: 23px;
    float: left;
    margin-left: 390px;

    } i need this in IE

    #hh2{
    font-family: Myriad Pro;
    font-size: 22px;
    color: #656565;
    padding: 23px;
    float: left;
    margin-left: 366px; look here !!

    }

  3. #3
    Join Date
    Mar 2011
    Posts
    1,160
    As you know, Microsoft stopped supporting conditional comments in IE10. You can't add a stylesheet exclusively for IE10 with CSS alone. You *could* use JavaScript to sniff the User Agent string and write a <link> tag if you see IE10, but the best solution is to fix your CSS.

    IE10 has pretty good support for the W3C standards. Chances are that you're just running into different default values for things like margins among the various browsers. You might try one of the CSS Reset stylesheets, or just add:

    * { margin:0; padding:0; }

    to the start of your existing stylesheet. It will almost certainly mess up your layout at first. But once you fix it, your page should look *very* similar in all browsers. If you post a link to a test page, someone here will be glad to help you work it out.

  4. #4
    Join Date
    Apr 2013
    Posts
    36
    i found the answer

    <head>
    <meta name="viewport" content="width=device-width, user-scalable=no" />
    </head>

    ccs:

    @media screen and (min-width:0\0) {
    #hh2{
    font-family: Myriad Pro;
    font-size: 22px;
    color: #656565;
    padding: 23px;
    float: left;
    margin-left: 366px;

    }

    }

  5. #5
    Join Date
    Mar 2011
    Posts
    1,160
    You found a work-around that solves the problem for the present, but it depends on a quirk of IE10. What are you going to do when IE11 comes out and this no longer works? Eventually, you're going to want a fix that relies on the W3C Standards and won't break over time.

  6. #6
    Join Date
    Sep 2013
    Posts
    221
    Try this.
    you can try some jQuery like this:

    if ($.browser.msie && $.browser.version == 10) {
    $("html").addClass("ie10");
    }

    It has worked fine for me. Hope this helps.

  7. #7
    Join Date
    Oct 2013
    Posts
    8
    If your site isn't displaying correctly in ie10 then theres probably a bigger issue than needing to hack a new css stylesheet together.

    As for a reset stylesheet, heres a link to the best one I have found (in my opinion)

    http://www.cssreset.com/

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles