acaciadigital.cl
true

Guide

CSS basics: layout and style

CSS decides how the structure written in HTML looks, from a single colour to the layout of a whole page.

Styles

Rules, boxes and layout

A rule has a selector and declarations. When several rules match the same element, specificity and order decide which one wins.

The box model

Every element is a box with content, padding, border and margin. box-sizing: border-box makes widths easier to predict.

Layout

  • Flexbox arranges items along one direction.
  • Grid places items in rows and columns.
  • Media queries change the rules when the available space changes.
Continue with JavaScript