CSS: / Home / StyleElement

The "style" Element

The "style" element is a Cascading Style Sheet or CSS. CSS is the language that describes how HTML elements should be displayed.

The "style"" element is placed in the "head" element. This is called an "Internal" style sheet.

  <head>
    <title>The "style"" Element</title>
    <meta charset="utf-8" />
    <style>
      a {
        background: lightsteelblue;
      }
    </style>
  </head>

A Style sheet contains rules for how specific elements are to be displayed.

A CSS Rule has two parts; the Selector which selects which elements use the Rule, and a Declaration Block which starts and ends with curly braces.

The Declaration Block contains a list of Style properties and values separated by semicolons. These properties and values have the same format as an "Inline" style.

<- StyleAttribute            ElementSelector ->
3StyleElement