Jump to content

Div With Fixed Position Without Javascript(just Css)


nibble
 Share

Recommended Posts

hi friends i want to put a div with fixed position in pages(just with css codes)but as you know IE doesnt support-> posiotion:fixedso i use these code for IE but they dont work

div#fixme {  left: expression( document.body.scrollLeft + 'px' );  top: expression( document.body.scrollTop + 'px' );}

div#fixedd {position: absolute;top: 0px;left: 0px;_top: expression(( 0 + (fixpos = document.body.scrollTop)) + "px");}

now what can i do?thanks in advance

Link to comment
Share on other sites

hi friends i want to put a div with fixed position in pages(just with css codes)but as you know IE doesnt support-> posiotion:fixedso i use these code for IE but they dont work
div#fixme {  left: expression( document.body.scrollLeft + 'px' );  top: expression( document.body.scrollTop + 'px' );}

div#fixedd {position: absolute;top: 0px;left: 0px;_top: expression(( 0 + (fixpos = document.body.scrollTop)) + "px");}

now what can i do?thanks in advance

You don't need "div#fixme" as #fixme is unique and doesn't need an identifier (just to save some unnecessary keystrokes).You can get fixed in IE via a bug described here.You might want to avoid that "expression" stuff as it is only for IE.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...