{"id":266529,"date":"2018-02-14T07:14:24","date_gmt":"2018-02-14T14:14:24","guid":{"rendered":"http:\/\/css-tricks.com\/?p=266529"},"modified":"2018-02-21T15:45:26","modified_gmt":"2018-02-21T22:45:26","slug":"css-basics-second-s-css","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/css-basics-second-s-css\/","title":{"rendered":"CSS Basics: The Second “S” in CSS"},"content":{"rendered":"

CSS is an abbreviation for Cascading Style Sheets. <\/p>\n

While most of the discussion about CSS on the web (or even here on CSS-Tricks) is centered around writing styles and how the cascade affects them, what we don’t talk a whole lot about is the sheet<\/em> part of the language. So let’s give that lonely second “S” a little bit of the spotlight and understand what we mean when we say CSS is a style sheet<\/em>.<\/p>\n

<\/p>\n

The Sheet Contains the Styles<\/h3>\n

The cascade describes how styles interact with one another. The styles make up the actual code. Then there’s the sheet that contains that code. Like a sheet of paper that we write on, the “sheet” of CSS is the digital file where styles are coded.<\/p>\n

If we were to illustrate this, the relationship between the three sort of forms a cascade:<\/p>\n

\"\"
The sheet holds the styles.<\/figcaption><\/figure>\n

There can be multiple sheets all continuing multiple styles all associated with one HTML document. The combination of those and the processes of figuring out what styles take precedence to style what elements is called the cascade (That first “C” in CSS). <\/p>\n

The Sheet is a Digital File<\/h3>\n

The sheet is such a special thing that it’s been given its own file extension: .css<\/code>. You have the power to create these files on your own. Creating a CSS file can be done in any text editor. They are literally text files. Not “rich text” documents or Word documents, but plain ol’ text.<\/p>\n

If you’re on Mac, then you can fire up TextEdit to start writing CSS. Just make sure it’s in “Plain Text” mode.<\/p>\n

\"\"<\/figure>\n

If you’re on Windows, the default Notepad app is the equivalent. Heck, you can type styles in just about any plain text editor to write CSS, even if that’s not what it says it was designed to do.<\/p>\n

Whatever tool you use, the key is to save your document as a .css<\/code> file. This can usually be done by simply add that to your file name when saving. Here’s how that looks in TextEdit:<\/p>\n

\"\"<\/figure>\n

Seriously, the choice of which text editor to use for writing CSS is totally up to you. There are many, many to choose from, but here are a few popular ones:<\/p>\n