February 23, 201412 yr So I have this problem.. I was working on a drop down menu but when I hover over it moves all the content down. I suppose it's an issue with positioning, but I cannot locate the issue, so I'd need your help. Also the alignment of the sub-menu list items is off. Here's the code: http://codepen.io/anon/pen/uqFem Thanks for help
February 24, 201412 yr http://csswizardry.com/2011/02/creating-a-pure-css-dropdown-menu/ This link should be able to help you
February 27, 201412 yr Have you tried css reset ? It might by some default padding or margin of the second ul or its descendants ... Or you could try position of second ul to absolute which should not affect other elements . Have a look on this > http://jsbin.com/wuxoyina/1/edit
February 28, 201412 yr header nav ul li > ul{ display: none } header nav ul li:hover > ul{ display: block } header nav ul li > ul li{ margin: 0; line-height: 50px; display: block; position: relative; } header nav{ text-align: right; display: inline-table; line-height: 105px; font-family: 'Open Sans Light', sans-serif; font-size: 25px; } header nav a{ font-family: 'Open Sans Light', sans-serif; font-size: 25px; color: black; margin-right: 15px; } header nav ul { position: relative; } header nav ul:after{ content:''; clear: both; display: block; } header nav a:hover{ color: grey; } header nav ul li{ display: block; float: left; } header nav ul ul { padding: 0; position: absolute; top: 100%; } replace your css with the above. You needed to set header nav ul ul as absolute positioned so it didn't push the below content down when it appeared. And in order to be able to absolute position it I added position: relative to it's parent Edited February 28, 201412 yr by realflairdesign
Create an account or sign in to comment