开发者

Dropdown CSS menu contracting

开发者 https://www.devze.com 2023-03-10 18:49 出处:网络
I have implemented a dropdown menu into a webs开发者_如何学编程ite, here: http://www.gardensandhomesdirect.co.uk/

I have implemented a dropdown menu into a webs开发者_如何学编程ite, here:

http://www.gardensandhomesdirect.co.uk/

However, The dropdowns themselves seem to contract prematurely. Its sometimes difficult to keep the dropdown open when moving from the initial button onto an option in the dropdown.

Is this a problem with the code or something is affecting it? Is there anything I can do?

Thanks!


Your dropdown divs .dropdown_Xcolumns have a top margin of 4px, When the mouse is on these 4px it's breaking the hover (unless it's done really fast!).. remove the top margin and all should be well.

If you want the effect of a gap between the <li> and the dropdown div - try a top white border on that div

or alternatively, leave the top margin, and add 4px bottom padding to the container <li>s to make them meet up better


try to change for margin: 4px auto; to margin: 2px auto; for .dropdown_buildings in menu.css


You can try to add padding to each li element. It increase the active surface area of the hover area. When the user hover over the top nav and the sub-menu appears, the user can move the mouse downwards, and since he is now still within the padding area the hover is still activated.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号