pinaldave
asked on
position fixed does not work in IE
Hello Experts,
<style type="text/css">
.box1 {
position: fixed;
left: 1em;
top: 1em;
border: 3px solid black;
padding: .5em;
width: 8em;
text-align: center;
font-weight: bold;
font-size: large;
background: red;
color: white}
<div class="box1">This is a box positioned at a fixed position and should not scroll</div>
<style type="text/css">
.box1 {
position: fixed;
left: 1em;
top: 1em;
border: 3px solid black;
padding: .5em;
width: 8em;
text-align: center;
font-weight: bold;
font-size: large;
background: red;
color: white}
<div class="box1">This is a box positioned at a fixed position and should not scroll</div>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You don't always need javascript to mimic it in IE.
It can be done with css only in some cases. The result is not that bad, but it's very ugggggly code that is likely to break, so it should be avoided: http://www.serger.biz/ee/FixedMenu/FixedMenu.html
And using javascript should definitely be avoided.
The best thing is to use "position:fixed" and use a workable non-fixed alternate solution for bad browsers.
You can always have a little message that tells your visitors to use a good browser if they want to enjoy the site's complete functionality.
It can be done with css only in some cases. The result is not that bad, but it's very ugggggly code that is likely to break, so it should be avoided: http://www.serger.biz/ee/FixedMenu/FixedMenu.html
And using javascript should definitely be avoided.
The best thing is to use "position:fixed" and use a workable non-fixed alternate solution for bad browsers.
You can always have a little message that tells your visitors to use a good browser if they want to enjoy the site's complete functionality.
ASKER
I did not know that.
Trevorhart.. .thanks for answer.
Actually I am preparing the CSS tutorial so I will mentioned this as a drawback. I will not need the javascript for today. Thank you for offer.
Regards,
---Pinal