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!

Position layer off screen but with no page scrolling?

Status
Not open for further replies.

pha2er

Programmer
Dec 4, 2001
16
GB
Hi there,

Can anyone tell me if it's possible to position a layer way off screen so no-one will see it, and there will be no page scrolling?

Cheers.
 
Yes.

You can position a layer absolutely like this

<div style=&quot;position:absolute; left:1200px; top:200px;&quot;>

this will put a div 1200 pixels formt he left which in the majority of cases wopuld be off the screen. To prevent a horizontal scrollbar you would need to use the overflow property for the body tag in your stylesheet like this:

body{overflow-x;none;}

however for IE5 suppport you also need to specify a scrollbar for the y direction or it will inhereit the x property so

body{overflow-x;none; overflow-y:visible;}

would be better

hope this helps

rob

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top