Learning CSS

The purpose of a CSS file

The programming language CSS is a bit different to HTML.

CSS is not used to put content on your website like HTML (by content we mean uploading content in the form of text, images, videos, links, etc on the web). CSS is rather used to style specific HTML tag elements to make them be displayed on a particular way on your website.

Creating and linking a CSS file to your HTML file

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.

First you have to learn how to link a CSS file to your already created HTML file. You do this by revisiting your HTML document and inputting the following on its <head> tag element:

write12Example

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

<body>
</body>
</html>

Note that all the information you will need to link your CSS file to your HTML file is inside the <link> tag element. Within the href property you will have to write the exact name of your created .css file, in the example above we are linking a CSS file we named ”design.css”.