Chapter 10. CSS: Sizing and Spacing

CSS Box Model

CSS Box Model
Tag:

CSS uses the Box Model concept for HTML element styling and design layout. The Box Model consists of four key parts.

  1. Content : Text or images. Other boxes can be nested here as well. You can add background designs in this part (e.g., background color, background image, etc.).
  2. Padding : The area around the content. This part is also included in the box background.
  3. Border : The outline of the box. You can set border color and other designs using CSS.
  4. Margin : The outside border that determines distances to other boxes. This part is notincluded in the box background, andit is always transparent.

CSS uses the Box Model concept for HTML element styling and design layout. The Box Model consists of four key parts.

  1. Content : Text or images. Other boxes can be nested here as well. You can add background designs in this part (e.g., background color, background image, etc.).
  2. Padding : The area around the content. This part is also included in the box background.
  3. Border : The outline of the box. You can set border color and other designs using CSS.
  4. Margin : The outside border that determines distances to other boxes. This part is notincluded in the box background, andit is always transparent.
Tag: