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

How To

How to Include CSS File in ASP

Contributor
By eHow Contributing Writer
(0 Ratings)

Cascading Style Sheets are handy ways to make layout styles for your webpages. CSS styles can be saved in the webpage file or saved in a separate file and linked in each page. The industry standard is to keep style classes for CSS in a separate file, so when changes are made to the website layout, only one change is needed in a single file.

Difficulty: Moderate
Instructions
  1. Step 1

    Open an ASP page. Each ASP file that you create needs to have the CSS file linked in its header information. Open the file in which you want to insert the code.

  2. Step 2

    Save the CSS file. If you haven't already saved the file, save your class file in the directory where the ASP pages are located. The common name to use when saving a CSS file is styles.css.

  3. Step 3

    Insert the link code. Place the following code in your ASP page:

    <link rel="stylesheet" type="text/css" href="styles.css">

    This code must be placed between the title tags. The following is a sample of what the initial ASP code would look like:

    <html>
    <head>
    <title>My First CSS Class File Link</title>
    <link rel="stylesheet" type="text/css" href="styles.css">
    </head>
    <body>

    My CSS file class.

    </body>
    </html>

  4. Step 4

    Save the ASP file. Press the "Ctrl" and "S" keys at the same time to save the current ASP file.

  5. Step 5

    Test your code. Open your website in a browser to verify the link to the style class file. If your website reflects changes made in the CSS file, then you've correctly placed the HTML code in the ASP file.

References

Subscribe

Post a Comment

Post a Comment

Related Ads

  • Have you done this? Click here to let us know.
I Did This
Tags
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