CSS (Cascading style sheets)
CSS is used to ensure to encapsulate formatting in HTML.
HTML was never intended to contain any styling in the files.
We can save the styling of a website in one file, and then change the styling just by changing the file and only changing some identifiers in the HTML.
First, create the .css
file somewhere in the repo. Then, you need to link the .css
within the HTML file.
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>