eHow launches Android app: Get the best of eHow on the go.

How To

How to Create One CSS File for Your Entire Website

Contributor
By eHow Contributing Writer
(3 Ratings)

It's useful to keep one CSS file for the entire website rather than having individual CSS styles in every page. With separate CSS files, it's easy to update and maintain the look and feel of the entire website from a single file. Follow these steps to learn how.

Difficulty: Moderately Easy
Instructions
  1. Step 1

    This is a commonly defined internal CSS style: .

  2. Step 2

    To convert this style to an external file, copy the code (only the code between "") into "Notepad" and save it as "style.css."

  3. Step 3

    Now open an existing html page (or create a new html page, and save it as myStyle.html in the same folder as your style.css file). In the source code of the page between the tags add the following line: .

  4. Step 4

    You've created an external CSS file and linked it to the page. Apply this CSS style to the content of the page. Applying CSS style inside the page can be achieved differently. For now, use only "" tags. Span tags are used this way: Content Comes Here. All the content between these "" tags will contain your "allContent" style properties.

  5. Step 5

    The source code of your page should look like this:
    My Page






    Your Content Here


    .

Tips & Warnings
  • If you're creating a totally new CSS file then you have to follow this structure: .StyleName { properties }.
  • Properties should be defined as shown: property-name: value;.
  • The copy/paste method with Microsoft Word may not work on some websites properly due to the invisible code it contains.

Comments  

almurphy said

Flag This Comment

on 5/19/2008 This article makes little sense of understanding of how to use the instruction because it offers no example of how to apply the code to the tag. Sorry, but I got nothing from reading this.

Subscribe

Post a Comment

Post a Comment

Related Ads

  • Have you done this? Click here to let us know.
I Did This
Get Free Internet Newsletters

Copyright © 1999-2009 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy .   en-US Portions of this page are modifications based on work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License. † requires javascript

Demand Media
eHow_eHow Technology and Electronics