← CSS Styling
CSS foundations · 15 MIN

Connecting CSS to HTML

Connecting CSS to HTML

External stylesheets are usually best for real projects because they can be cached and shared. A link element in head loads a stylesheet. Internal style elements are useful for small demonstrations; inline styles are harder to maintain and override.

Try it yourself

Change the example, run it, and explain the result in your own words. Then create one variation of your own.

Key idea

Use the example as a starting point, not something to memorize. Practise, inspect the result and make small improvements.

Code example

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