Dropdown list alignment issue (HTML/CSS)

后端 未结 3 1513
走了就别回头了
走了就别回头了 2021-01-29 05:43

I\'ve asked a question like this before, but I am using differnt code to last time.

I\'m trying to create a dropdown menu. Ther are certain elements in that main list th

3条回答
  •  借酒劲吻你
    2021-01-29 06:25

    You just need to add padding: 0 to your nav ul ul rule so it appears like so:

    nav ul ul {
        display: none;
        position: absolute;
        padding: 0;
    }
    

    By default, ul elements have a left padding of 40px, you need to remove that padding to make the second level ul align with the first.

提交回复
热议问题