Internal CSS
A style element in the head holds full CSS rules that style every matching element on that one page only.
Apply shared rules within one document and identify their scope.
The café is putting up a one-off page for its monsoon festival. It has its own look and will never be reused. Instead of creating a separate file, you can keep the CSS on the page itself, in a style element.
The rule
A style element styles one whole page, from one place.
Internal CSS sits inside a <style> element in the page's <head>. Its contents are ordinary CSS rules, not HTML attributes:
<head>
<title>Monsoon Festival — Harbour Café</title>
<style>
h1 {
color: teal;
}
.price {
color: green;
font-weight: bold;
}
</style>
</head>Compared with inline CSS, this is a big step up. One rule for .price now styles every price on the page, and you can use every kind of selector and media query. The looks are gathered in one block instead of scattered through the tags.
Its limit is the page boundary. A style element affects only the document it is in. If the café's five pages each carry the same block, they are five separate copies, and a new brand colour means five edits.
There is also a small cost in download: the CSS travels inside every page, so a browser cannot keep one copy and reuse it the way it can with a separate file.