PBMining

Searching...
Thursday, December 15, 2011

Positioned absolute child relative to it's parent

3:10 AM

Positioned absolute child relative to it's parent



when you define position style to "absolute" it pop off document hierarchy flow. and after if you set its top,bottom,right,left style property then it always respect to main window and not to its dom parent,so what do if we want to positioned absolute child repective to its parent using "top,bottom,right,left" style property, there is one solution is that:

1: set style for parent "position:relative"
this will define context door for its all absolute child ,and after if you set for ex:-

style="top:1px"

this will positioned child to 1px from top of its dom parent, and not to its main window because you create context door by setting its parent to relative....

0 comments:

Post a Comment

Write your review about this post.