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!

Relative Layers

Status
Not open for further replies.

gllew

Programmer
Jul 10, 2001
2
US
What's the syntax and uses of using layers with relative positioning as opposed to absolute positioning?
 
Hello gllew!

Syntax as for absolute positioning just change:
style="position:relative; ..."

The differences between them are:
- absolute positioning takes its X and Y coordinates from the top left corner of the page (0, 0);
- relative positioning takes its X and Y coordinates not from top left corner of the page, but RELATIVE on some other object.

For example you have FORM object before your layer and its (layer's) X and Y are 25, 25 -
- using absolute positioning your layer will be 25 pixels right from the left border and 25 pixels down from the top of your page. No matter is where FORM object starts and ends;
- using relative positioning it will be 25 pixels right from the left and 25 pixels down from the bottom of FORM object. So its X and Y starts not from page's top and left, but from the lower pixel of FORM object (dependes on X and Y of the prevoius object, in our case FORM object).

You can experiment with enclosed layers, one with absolute positioning and second (which is enclosed) with relative. (It looks a little bit different in IE and NN)

Good Luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top