CSS Box Model and Positioning

Objectives

  • Describe the difference between block, inline, and inline-block elements
  • Adjust element spacing using padding and margin
  • Create floating elements to position content removed from the standard document flow
  • Explain the difference between and use cases of static, relative, fixed, & absolute positioning
  • Create a page with multicolumn layout

The Box Model

box-model

  • Margin - clears an area around the border; the margin does not have a background color, it is completely transparent
    • The margin is outside the element
  • Border - a border that goes around the padding and content; the border is affected by the background color of the box
    • The border is inside the element
  • Padding - clears an area around the content; the space between the content and the border; the padding is affected by the background color of the box
    • The padding is inside the element
  • Content - The content of the box, where text and images appear
    • The content is inside the element

results matching ""

    No results matching ""