Skip to content

Try our new Crash Courses!

Buy one of our new Crash Courses, now hosted on Podia.

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 Reference > CSS Introduction