CSS (Cascading Style Sheet) is a format used to customise the format of HTML content.
Styles describe how the elements of a markup document should be displayed.

Structure of a CSS style

selector {
    property-name: value;
}

Some basic properties

  • color: the text colour
  • font-size: the font size
  • font-style: the style of the font
  • text-decoration: the decorations on the text

Inline Styles

Styles can be defined in the style attribute of HTML tags

External Styles

<head>
    <link rel="stylesheet" href="styles.css">
</head>

Cascading

Stylesheets are cascading as many stylesheets can have overlaping rules, the browser give sstyles to elements based on prioeirty:

  1. inline styles
  2. document-level styles
  3. selector specificity
  4. order of declaration