CSS Drop Down Menu

前端 未结 3 730
梦如初夏
梦如初夏 2020-12-04 04:00

I\'m trying to make a simple CSS drop down menu that when you mouse over a link, the sub menu appears. I\'ve managed to achieve this when you mouse over an li but can\'t fig

3条回答
  •  既然无缘
    2020-12-04 04:18

    I would avoid using JS for this if possible. It's not necessary. Just stick a div inside your li (with a bit less padding on it than the li itself) and style the div:hover to display:block;.

    Here's a fiddle demonstrating the approach. It's much like what you already have.

提交回复
热议问题