Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

position:fixed within Internet Explorer

Status
Not open for further replies.

saroy71

Programmer
May 16, 2002
22
CA
I am trying to use position:fixed on my website and it works perfectly in Netscape 6 and Mozilla 1.1, however, it treats it as a position:absolute in Internet Explorer 6.

Does anyone know if there is a way around this problem or have you heard if Microsoft will be updating IE to correct this problem? Education is what you get from reading the small print.
Experience is what you get from not reading it.
 
IE css position attribute values:

absolute| relative | static

'fixed' will not be understood by IE when used with the position attribute
 
Correct. I was wondering if anyone knew of a way to work around this so that my site would look and act as if I was using position:fixed.
I know how to do it with images that are part of the background but I need interactive images that "act" like they are fixed in a position.
Anyone know if Microsoft is going to recognize position:fixed in the future? Education is what you get from reading the small print.
Experience is what you get from not reading it.
 
IE css background values:

background: [colour] [image] [repeat] [attachment] [postion]

colour: usual colour values go here string or hex
image: path to bg image goes here wrap it in url ie url(test.jpg)
repeat: repeat, no-repeat, repeat-x or repeat-y
attachment: scroll or fixed
position: length, percentage, valignment, halignment


as you can see IE has more support than Netscape, use the above values to sort out your background, hope this helps
 
My images are NOT background! I need them to be 'foreground' because they are buttons, etc.

But thanks anyway for your help. Education is what you get from reading the small print.
Experience is what you get from not reading it.
 
Try a table thats what I did. If you want to create a transparent gif the and set it as the background. Your viewers won't be able to see it and it will get IE to have your site in a fixed the position. To do this just use the css background properties. Here's my css code

<style type=&quot;text/css&quot;>
body{
background-repeat: no-repeat;
background-position:left top;
}
</style>

Let me know if this helps

Lmarshall
 
It is possible to use javascript to achieve a similar effect in IE (although it isn't as good as using position:fixed). I'm not that fluent in javascript, so i couldn't tell you the exact code, but basically you get a function which moves a div block to be called every time the page is scrolled. You put your stuff that you want to stay fixed in that div. Thus, it moves down the page as you scroll, and if you set it right, you can make it appear to be in the same position relative to the viewport.
Just look up &quot;free js scripts&quot; or somesuch with your favorite search engine.. There are plenty of websites devoted to publishing little codes like this

Of course, you could always just forget IE and put in a nice little &quot;get mozilla&quot; page... :)

Good luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top