content box vs border box code example

Example 1: 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;

Example 2: difference bw box and border box

.alligator-box {
  box-sizing: border-box;
  width: 125px;
  height: 125px;
  border-width: 10px;
  padding: 40px;
}

Example 3: difference bw box and border box

.alligator-box {
  box-sizing: content-box;
  width: 125px;
  height: 125px;
  border-width: 10px;
  padding: 40px;
}

Tags:

Misc Example