How to Include CSS File in ASP

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.

Instructions

    • 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

      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

      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

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

    • 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.

Related Searches:

References

Comments

You May Also Like

Related Ads

Featured