/* Example comment

in a document */

You will notice that you denote the start of the comment with a /* and mark the end with a */. Comments can span on to multiple lines if necessary. It’s good practice to write meaningful comments where necessary throughout your CSS file.

Inserting CSS

We have now discussed the role and syntax of CSS, but you might be wondering where and how we document our CSS to be read by the browser. Well, there are actually three different methods we can use to ‘insert’ our CSS into our webpage document. They each have their own uses and benefits, which we will run through now. The three methods are as follows.

External style sheet

This approach allows us to write all of our CSS code in one.css file, which we reference (link to) in our webpage. You can include this link on as many webpages as you wish. We can then simply update this.css file at any point and have the styles update across all of your webpages at once.

The.css file is simply a plain text file that can be created in any text-editor, saved with the.css extension, then your rules are simply listed in there without any other special syntax. Here is an example.css layout