gpt4 book ai didi

css - 顶部和左侧间隙较大的垂直 CSS 菜单

转载 作者:太空宇宙 更新时间:2023-11-03 18:42:02 24 4
gpt4 key购买 nike

我有一个垂直的 CSS 菜单,但是左边和上面有一个空隙,我不知道从哪里删除它 - 我的菜单 CSS 在下面,我用我的完整代码创建了一个 fiddle :

#vertical_menu {
float:left;
}
#vertical_menu > ul > li {
display:inline-block;
width:140px;
}
#vertical_menu > li {
display:inline-block;
list-style:none;
margin-left:-20px;
}
#vertical_menu li a {
display:block;
padding-bottom:10px;
margin-top:15px;
border-bottom:4px solid #000000;
color: #000000;
text-decoration:none;
}
#vertical_menu li a:hover {
border-color:#666666;
color:#666666
}

有什么想法吗?

http://jsfiddle.net/Dfw9f/1/

最佳答案

我认为您正在寻找的是重置 CSS,请检查 CSS Tools: Reset CSS

The goal of a reset stylesheet is to reduce browser inconsistencies in things like default line heights, margins and font sizes of headings

为了快速解决,只需将其添加到您的 CSS

ul,tr,hr{margin:0;padding:0;}

关于css - 顶部和左侧间隙较大的垂直 CSS 菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17348365/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com