If you hover over the User menu, then the menu shows up at left = 0. But, it should show up exactly under the User ‘button’. How can I accomplish this? (only CSS3)
If you hover over the User menu, then the menu shows up at left
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Add this rule to your CSS:
Explanation: if you specify
position: absoluteon an element,topandleftwill be relative to the first parent element that has anypositionother thanstatic. If no element like that is found, it will be relative to the page (like in your case). Specifyingposition: relativeis the easiest solution because the element won’t be taken out of the document flow.