Skip to article frontmatterSkip to article content
tools = require('../js/tools'); tools.init()
Loading...

3 ways to apply CSS

method 1 : a separate CSS

this is the preferred method

Loading...

URLs

where

relative URLs

it is possible to omit some parts of the URL; and that’s exactly what we’ve done when we wrote href="hello.css" in our <head> above

imagine if you have loaded a document as, say https://hostname.io/the/path/to/content
then from within that document:

and the same goes with the file:/// URL scheme

method 2 : inline in html

back to the topic of injecting CSS in the page

Loading...

method 3: hardwired with style=

Loading...

practice

practice (continued)

the browser cache

for performance reasons primarily :

beware of that during development

how to deal with it

a couple hints and workarounds