CSS: create a footer (header) for your asp page

I write this post because someone asked me how to create footer in an asp page. That's the main reason. However, after writing a lot about Sql Server functions (and I don't think I am really finished with that!), I indeed needed a break. Anyway...
Creating a footer for your asp page is very easy. I will show you how to do it with css styles, assuming you have a default.asp page which is your home page, an include named footer.asp which is your footer and an external css.css page containing your styles.


The default.asp page
Your default page should be something like:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>



Home Page



This is the main body text of your page


That is just a very simple example, complete the code with whatever you want, and save it as default.asp.

The footer.asp page
In the footer.asp page you put the content of your footer. Something like:

 
   
This is the place where you put the footer text

 
Save it as footer.asp.
As you may have noticed, we used a class named "footer" in our table tag. That is what will style the table.

The css.css file
The css.css file is where we style the table in the footer.asp page. The code should be:
.footer {
    position:absolute;
    bottom:0px;
    left:0px;
    width:100%;
    height:60px;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    text-decoration: none;
}
The code will place the footer at the bottom of the home page with an absolute positioning. Width, height, font-family, font-size and text-decoration can be changed according to your needs.

If I want a header?
The css style can be easily modified in order to convert your footer in a header. In the above css style, replace:
bottom: 0px;
with
top: 0px;
and you're done.

Enjoy yourself and happy programming!