tags:

views:

39

answers:

2

how to make a div with fixed position at top Of the page that work in all browsers like IE

+2  A: 

A div that will always stay at the top of the page (in this case, 5px from the top):

CSS:

.mydiv {
    position: absolute;
    top: 5px;  /* or however far you want it from the top of the page */
}

HTML:

<div class="mydiv">this will always be 5px from the top of the page</div>
Jeff
A: 

foo { position: fixed !important; position: absolute /* fallback for IE6 */; }

reisio