Thursday, January 31, 2008

CSS Fixed footer, fixed header


/* Tested in IE6,IE7, Safari and FF */

html, body {
padding: 0;
margin: 0;
_background: url(nothing) fixed;
}

.fixed-bottom {
position: fixed;
bottom: 0;
left: 0;
_position: absolute;
_top: expression(document.body.scrollTop + (document.body.clientHeight - this.clientHeight));
}

.fixed-top {
position: fixed;
top: 0;
left: 0;
_position: absolute;
_top: expression(eval(document.body.scrollTop));
}

No comments:

Post a Comment