CSS drop-down menus pushing page content down

前端 未结 1 724
清酒与你
清酒与你 2020-12-19 14:27

This is probably (hopefully) a pretty simple question, but I can\'t seem to get it to work so I\'ll turn to the experts here. I\'m using a pretty straightforward CSS drop-do

1条回答
  •  一向
    一向 (楼主)
    2020-12-19 14:46

    This is a pretty bad case of unnecessary Javascript to do what can be done via CSS itself. One way or another all you have to do is change:

    #cssdropdown li.headlink ul { display: none; border-top: 1px black solid; text-align: left;}
    

    to:

    #cssdropdown li.headlink ul { display: none; border-top: 1px black solid; text-align: left;position:absolute;}
    

    Here's an example of an extremely simple and clean drop down menu. Hope it helps you out a bit. I added a lot of comments to help you figure out what the CSS is doing to the HTML.

        
        
    

    0 讨论(0)
提交回复
热议问题