box-sizing: border-box => for IE8?

前端 未结 6 1177
太阳男子
太阳男子 2020-12-03 07:27

i want box-sizing: border-box for div tag.

For Mozila Firefox i have tried

        -moz-box-sizing: border         


        
相关标签:
6条回答
  • 2020-12-03 07:47

    IE8+ supports box-sizing.

    Support:

        Opera 8.5+  : box-sizing
        Firefox 1+  : -moz-box-sizing (still prefixed, though some are pushing to have it unprefixed for [Firefox 29][2]).
        Safari 3    : -webkit-box-sizing (unprefixed in modern versions)
        IE8+        : box-sizing
    

    Please review this jsFiddle

    0 讨论(0)
  • 2020-12-03 07:50

    box-sizing supports IE8+

    you can see here

    0 讨论(0)
  • 2020-12-03 07:54

    You are missing box-sizing: border-box; -

    *{
      box-sizing: border-box;
    
      -moz-box-sizing: border-box; 
      -webkit-box-sizing: border-box; 
    }
    

    IE Does not require vendor specific CSS -ms-box-sizing: border-box; is not needed

    Fiddle - http://jsfiddle.net/ctHh3/

    0 讨论(0)
  • 2020-12-03 07:58

    IE8 supports the unprefixed version of box-sizing, but as with all "new" CSS features it only does so in standards mode. -ms-box-sizing has never been used by any version of IE.

    Make sure your page has a doctype declaration to trigger standards mode in browsers. You should also place your unprefixed box-sizing after all the prefixes, not before them, and get rid of -ms-box-sizing as it's really not needed.

    0 讨论(0)
  • 2020-12-03 08:06

    If you are using min-width or min-height as well, box-sizing will be stuck as "content-box" in IE8 (Standards mode), i.e. specifying border-box will have no effect.

    0 讨论(0)
  • 2020-12-03 08:09

    put this in your page, problem solved

    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    
    0 讨论(0)
提交回复
热议问题