Pro HTML5 and CSS3 Design Patterns

(avery) #1
C H A P T E R 8

Positioning:


Indented, Offset, and Aligned


This chapter shows how margins can offset and align elements.
A stretched element is indented or outdented when one or more of its sides is displaced into or out of
its container, changing the width or height of the element.
A sized or shrinkwrapped element is offset when the entire element is shifted from its normal
position without changing the height or width of the element.
A sized or shrinkwrapped element is aligned when it’s relocated to one of the sides of its container
without changing its size and optionally offset from that side.


Chapter Outline



  • Indented shows how to indent an element from the sides of its container.

  • Offset Static shows how to offset an element from surrounding elements.

  • Offset or Indented Static Table shows how to offset a table from its container.

  • Offset Float shows how to offset a float from surrounding floats and content.

  • Offset Absolute and Offset Fixed shows how to offset an absolute element from
    the position it would have had in the normal flow.

  • Offset Relative shows how to offset any element without affecting other elements.

  • Aligned Static Inline shows how to align inline elements horizontally and
    vertically.

  • Aligned and Offset Static Block shows how to align and offset static block
    elements.

  • Aligned and Offset Static Table shows how to align and offset tables.

  • Aligned and Offset Absolute shows how to align and offset absolute elements.

  • Aligned-center Absolute shows how to center absolute elements.

  • Aligned Outside shows how to align elements to the outside of their container.

Free download pdf