Home › CSS Tutorial › CSS installation
CSS installation
Full step-by-step installation for Windows, macOS and Linux.
Step 1: Install a code editor
- Open
code.visualstudio.comand click the Download button for your system. - Windows: run the installer, accept the agreement and tick Add to PATH and Open with Code. macOS: open the downloaded zip and drag Visual Studio Code into the Applications folder. Linux: run
sudo snap install code --classicor install the .deb file. - Open VS Code once to make sure it starts.
Step 2: Create your files
- Create a folder, for example
my-site, and open it in VS Code. - Create
index.htmlandstyle.cssinside it. - In
index.html, add<link rel="stylesheet" href="style.css">between<head>and</head>. - Write a rule such as
h1 { color: crimson; }instyle.cssand save both files.
Step 3: See the result
- Double-click
index.htmlto open it in your browser. - Change the CSS, save, and press F5 to see the new look.
Tip: inspect any page
Press F12 in the browser to open the developer tools. You can try CSS live on any element before you write it in your file.
If something goes wrong
- Styles do not apply: check that the
hrefname matches the file name exactly. - Old styles still show: press Ctrl+F5 for a hard refresh.
Commands in this lesson
href
Definition: Attribute of a that sets where the link goes.
Syntax:
<a href="URL">text</a>
Example:
<a href="https://example.com">Go</a>Example code
<style>
h1 { color: crimson; }
</style>
<h1>CSS is working</h1>