CSS Position:Absolute with relative adjustment

Posted by Gidiyo on Stack Overflow See other posts from Stack Overflow or by Gidiyo
Published on 2010-05-29T02:06:19Z Indexed on 2010/05/29 2:12 UTC
Read the original article Hit count: 236

Filed under:
|

I am trying to do a vertical dropdown menu. This is my code

.menu li:hover>ul{
position:absolute;
display:inline;
    left:120px;
    top:100px;}

I use position: Absolute to remove the sub-menu from the table, once the menu gets hovered. It appears that, if I do not indicate top or left property. The sub-menu will displayed relatively. Now I need to adjust the position relatively but seems that only the left property works. So my sub-menu left position is 120px relatively away from its original position. But the top is 100px away from the top of the window, rather then to the original position. How do I move the list up relative to it original position? I cant use position:relative because I need the sub-menu to be remove from the table.

© Stack Overflow or respective owner

Related posts about css

Related posts about css-positioning