-moz-box-sizing property | -webkit-box-sizing property
-moz-box-sizing: | ||||||
-webkit-box-sizing: |
Specifies how the width and the height of the element are calculated. It affects the height and width properties.
In Internet Explorer and Opera, use the box-sizing property instead.
JavaScript page for this property: MozBoxSizing | webkitBoxSizing. You can find other example(s) there. |
Possible values:
One of the following values:
The height and width properties include the padding and the border but not the margin. | |||||||
The height and width properties include only the content but not the margin, border and the padding. | |||||||
Takes the value of this property from the computed style of the parent element. | |||||||
The height and width properties include everything (margin, border, padding, content). | |||||||
The height and width properties include the padding but not the margin and the border. |
Default: content-box.
Example HTML code 1:
This example illustrates the use of the box-sizing, -moz-box-sizing and the -webkit-box-sizing properties:
|
||||
<head> <style> .sizingContentBox { width: 200px; height: 70px; border: 5px solid #ffbc79; box-sizing: content-box; -moz-box-sizing: content-box; -webkit-box-sizing: content-box; } .sizingBorderBox { width: 200px; height: 70px; border: 5px solid #ffbc79; box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; } </style> </head> <body> <div class="sizingContentBox"> Width and height do not contain the padding, border and margin. </div> <br /> <div class="sizingBorderBox"> Width and height contain the padding and the border but not the margin. </div> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by tags:
a, abbr, acronym, address, b, bdo, big, blink, blockQuote, body, caption, center, cite, code, dd, del, dfn, dir, div, dl, dt, em, fieldSet, font, form, H1, H2, H3, H4, H5, H6, hr, html, i, iframe, ins, isIndex, kbd, label, legend, li, marquee, menu, ol, p, pre, s, samp, small, span, strike, strong, sub, sup, table, td, textArea, th, tr, tt, u, ul, var, q, xmp
Related pages:
box-sizing
-moz-box-align
-moz-box-direction
-moz-box-flex
-moz-box-ordinal-group
-moz-box-orient
-moz-box-pack
-moz-box-align
-moz-box-direction
-moz-box-flex
-moz-box-ordinal-group
-moz-box-orient
-moz-box-pack
External links:
box-sizing (MSDN)
-moz-box-sizing (Mozilla Developer Center)
-webkit-box-sizing (Safari Reference Library)
-moz-box-sizing (Mozilla Developer Center)
-webkit-box-sizing (Safari Reference Library)
User Contributed Comments