ankitweblogic logo
W e b t u t o r i a l s

Define CSS

CSS Comment

CSS Selectors

Types of CSS

CSS Color Property

CSS Font Property

CSS Background

CSS Box Model

CSS3 Border Radius

Styling HTML Table

Styling Links

CSS Menu

CSS Display and Visibility

CSS Overflow Property

CSS Position, Z-index

CSS Outline, Offset

CSS Cursor Property

CSS3 box-sizing

CSS Web Layout

CSS Website

Google Fonts

Google Map

Login Form

Google Page

Facebook Page

CSS Assignment List

CSS3 box-sizing Property

The box-sizing property is used to tell the browser what the sizing properties. Should they include the border, padding in a box or just the contents.

box-sizingcontent-box | border-box.
Default value is content-box.

In content-box: border and padding is not included in the width and height of the element, whereas, in border-box: border and padding is included in the width and height of the element.

Example : Box-sizing: border box.


      div.container {
        width: 100%;
        border: 1em solid;
      } {
        width: 50%;
        border: 1em solid red;
        float: left;
        padding: 20px;
    <div class="container">
      <div class="box">This div occupies the left half.</div>
      <div class="box">This div occupies the right half.</div>
      <div style="clear:both;"></div>