Css sources

From wikinotes
Revision as of 03:05, 26 September 2021 by Will (talk | contribs) (Created page with " = External = <blockquote> Defined in separate file. <syntaxhighlight lang="css"> →‎path/foo.css: div { background-color: blue; } </syntaxhighlight> <syntaxhighlight l...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

External

Defined in separate file.

/* path/foo.css */

div {
  background-color: blue;
}
<!-- index.html -->

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

Internal

Defined in your html file.

<head>
  <style>
    div {
      background-color: blue;
    }
  </style>
</head>

Inline

Defined within the element properties.

<body>
  <div style="background-color: #F55;">
    foo
  </div>
</body>