How do I use external CSS styles?
-
An external CSS style is used by referencing an external file, with a
.css
suffix.For example an html document references the external CSS stylesheet using the <link> tag within the <head></head> tags
... <head> ... ... <link rel="stylesheet" href="style.css"> </head> <body> <p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Quod, laudantium aspernatur. Officia, consequatur! Fugit in obcaecati voluptatem doloremque beatae nisi! </p> </body> ...
The CSS stylesheet
style.css
has the following entries.p { background-color: red; color: white }
The result in the browser is:
© Lightnetics 2024