i want box-sizing: border-box
for div
tag.
For Mozila Firefox i have tried
-moz-box-sizing: border
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
box-sizing supports IE8+
you can see here
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/
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.
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.
put this in your page, problem solved
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>