Layouts

Box positions

Element types

  • block elements: div, p, ul/ol/li
  • inline elements: span, a, img

Normal flow

position: static

Relative position

Absolute position

Fixed position

Floats

Fixed width page

Liquid page


Exercises

  1. Create an HTML page and a new CSS file, link the CSS file in the HTML page.
  2. In the page, add 3 paragraphs.
  3. In the CSS, add 3 styles for relative, absolute, and fixed positions. Apply the styles to the above paragraphs.
  4. In the page, add 3 more paragraphs. In the CSS, add a float style. Apply the styles to these paragraphs.