Skip to content

Help us create more tutorials! Make a donation using the Donate button or become a member using the button below to hide this banner and track your progress.

Creating a CSS file

Details

The file extension for CSS files is .css.

To create a new CSS file in your text editor, create a new file using the menu or keyboard shortcut and then save it. In the dialog that pops up, give it a name and add the .css file extension at the end. As an example, you could name it main.css.

If the file name contains multiple words, use dashes to separate the words instead of spaces, like fonts-and-colors.css.

Exercises

First, create a CSS file in your project folder called main.css. Then create a second CSS file in this folder with a custom name.

References

CSS basics on MDN

Back to: CSS Course > CSS Introduction