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!

Positioning Layers

Status
Not open for further replies.

sweevo

Programmer
Jan 30, 2002
182
GB
I have just made a page layout using <div> layers to position form elements rather than tables, using absolute positioning.

This is fine at the design resolution (800*600) but obviously not at different ones. I don't want the elements to be stretched apart as would happen if I used % values for the positions, so is there a way I can used nested layers and position the elements from the parent's edges rather than the screens - and have the parent centred?

Alternatively, what is the best way of having everything centred nicely?

Any help would be appreciated. Thanks...
 
<!--
// grab the screen width
var cwidth = screen.width;
// so fit your <div id=&quot;x&quot;>
function fitdiv() {
if (cwidth > 1024) {
// more than 1024x768
} elseif (cwidth == 1024) {
// 1024x768
} elsif (cwidth == 800) {
// 800x600
} else {
// lowers ..
}
}
// dont forget to call onload=&quot;fitdiv()&quot; in your <body>
// hope this helps ---------------------------------------
wmail.jpg


someone knowledge ends where
someone else knowledge starts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top