How does one actually create a cascading style sheet?

A CSS file is nothing more than a special kind fo text file.

  1. Open Notepad
  2. Type

    body{
    margin : 0;
    padding : 0;
    font: small Verdana, Geneva, Arial, Helvetica, sans-serif;
    background-color : #ffffff;
    color : #000000;
    }

  3. Click File…Save As
  4. Change “Save as Type” box to “all files”
  5. Type “test.css” in the “File name” box
  6. Choose a location to save the file
  7. Click Save
  8. You have now created your first CSS file!

The actual name of the file is unimportant. Though most typically call it “style” or “screen” or “print”. The thing that made this simple text file a CSS file is the extension. By giving it an extension of “.css”, html editors, web pages and text editors will recognize this file as a cascading style sheet.

For more examples on CSS files, visit our recommended CSS tutorials page.

 

About the Author

Paul Flyer loves to research the web and find resources and tools for building, maintaining and promoting websites. Based in Saint Louis, MO, he works in management and spends his free time sharpening his web development and copy writing skills. Feel free to contact Paul with any questions, comments or ideas. He is also available to help you with your own website.