Skip to main content

Command Palette

Search for a command to run...

[VISUAL] CSS Intro, Syntax & the CSS Cascade

Published
1 min read
[VISUAL] CSS Intro, Syntax & the CSS Cascade
N

Aspiring Frontend Engineer

Image description

CSS Syntax

Image description

Image description

Image description

Image description

CSS Specificity

Image description

Image description

Image description

To write the css in a seperate file, you have to link that file to the html. In the head element, make a new element called link and write this:

<head>
    <link href="styles.css" rel="stylesheet"/>
</head>

href attribute specifies the path of the file, if the file is in the same directory as the html, then you just write the file name.

href stands for hypertext reference and yes the value of that attribute (the path) is a reference to the file.

rel stands for relation and here we are specifying the relation of that file we referenced. Is it a stylesheet file, a favicon, it is an alternative page in a different language?

More from this blog

My Technical Blog

38 posts