CSS: Creating & Linking a CSS file

Note: Here in WordPress you won’t need to create a CSS file as one already exists. To learn how to style HTML elements in WordPress click here!

A CSS file is easily created by creating any file that finishes with the extension “.css” (for example, creating a file named “design.css”). Once made, your next job before actually inputting CSS code on your CSS file is to link it to your HTML file which holds all the content of your website.

How do you link a CSS file to your HTML file?. You do this by revisiting your HTML document and inputting the CSS file’s name on its <head> element. In the example below, a CSS file named “design.css” is linked to an HTML document.

write12Example

<!DOCTYPE HTML>
<head>
...
</link rel=”stylesheet” href=”design.css” type=”text/css” media=”screen”>
...
</head>

<body>
....
</body>
</html>