box-sizing html code example

Example 1: * box-sizing border-box

*{
box-sizing: border-box;
}

Example 2: textarea { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; width: 100%; }

textarea {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;

    width: 100%;
}

Example 3: box sizing border box

*{
 box-sizing: border-box;
 }

Example 4: box-sizing border-box vs content-box css

box-sizing:content-box;
	"Default. The width and height properties (and min/max properties) includes only the content. Border and padding are not included"
box-sizing:border-box;	
	"The width and height properties (and min/max properties) includes content, padding and border"

Example 5: how to style rule to apply the Border Box model css

header, ul, nav, li, a /* other elements */{

 display: block;
   -webkit-box-sizing: border-box;
   -moz-box-sizing: border-box;
   box-sizing: border-box;

Tags:

Css Example