0

In fact I am much familiar with HTML and CSS but when it comes to setup multiple hierarchical div with relative and absolute position giving me damn trouble.

What I have is below

<div id="firstdiv">

   <div id="secdiv">

      <div id="thirddiv">

         <div id="forthdiv">

         </div>

      </div>

   </div>

</div>

Now I want to align most div on absolute position so I set position relative to #firstdiv now set position absolute to #secdiv and all is going well

Now I want to set my #forthdiv absolute to #thirddiv and so I set #thirddiv to position relative and #forthdiv to position absolute and hear I am getting trouble.

#forthdiv is not considering parent (#thriddiv) relation but it is considering #firstdiv relation and getting position according to #firstdiv.

Now how to set this all so absolute position div only consider its own parent and not root

1
  • 2
    post your CSS. It should work if you have thirddiv set to position=relative.
    – Oliver
    Commented May 28, 2012 at 9:38

1 Answer 1

0

Try something like this

http://jsfiddle.net/Mcp6L/

1
  • I already did this. Let me check other areas if affecting to it. I have spend whole morning to design this and when I am adding this to the site its taking now site parent div as a relative. Fufl.. let me check thanks and get back to you soon
    – Code Lover
    Commented May 28, 2012 at 10:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.