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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

poistiong div always at the same place

Status
Not open for further replies.

spicymango

Programmer
May 25, 2008
119
CA
Hi, I have a page that is quite long vertically.

It has links like

<a href=cnn.com>Line1</a>

<a href=cnn.com>Line2</a>

<a href=cnn.com>Line3</a>

<a href=cnn.com>Line4</a>
.
.
.
.
.

.
.
.
.

.
.
<a href=cnn.com>Line100</a>

I have a a hidden div statement that appear when someone clicks on the link, but I want that div to appear always at the same place, let suppose on the center of tha page, how could i do that? with absoule poistioning , if the person has scrolled down then they don't sometine even see the div when they click on the link

Code:
<div style="position: absolute; left: 610px; top: 80px; height: 400px; width: 100px; ">my stuff</div>
 
You could try position: fixed; instead of absolute. This is supported by modern browsers (you can find solutions to make it work with non-standards compliant browsers via google etc).

Cheers,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
hi I tried your suggestion, like the following


Code:
<style>
#hourglassPDF {left:350; top:400px; height:100px; width:550px;
position:fixed; z-index:1;}
</style>

<div id="hourglassPDF" style="DISPLAY: none">
<table  border=1 height=100 width=500 cellpadding=0 cellspacing=0>
<tr><td   bgcolor="FFFF99" align="center"><b>Downloading PDF in progress, please wait ...</b></td>
</tr>
</table>
</div>

It worked in FireFox fine, but in IE 6.0 div statment will not even show up, after the change
 
Me said:
... This is supported by modern browsers...
In this instance, IE 6 is not considered a modern browser... unlike Safari 3, Firefox 2, Opera 9 and IE 7 (which all support position:fixed).

Like I said, though, there are solutions available for this. Using conditional comments (check out the FAQ faq215-6625 has more details) you can target IE 6 specifically and serve a behaviour that will allow you achieve the same end result (probably the best solution, but not necessarily the only one).

I used this google search for a bunch of useful results.

Cheers,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top