【问题标题】:CSS: can't eliminate space on inline listCSS:无法消除内联列表上的空格
【发布时间】:2013-05-17 04:52:18
【问题描述】:

我在底部构建了一个 CSS 导航栏。由于某种原因,左侧有这个小缓冲区,似乎没有什么可以消除它。这会阻止我的链接正确居中。

我试过padding-left: -10px,但它不会向左移动,即使padding-left: 10px 确实将它向右移动。

body {
    padding: 0;
    margin: 0;
}
    html, body, #map {
    height: 100%;
        }

footer {
    position: fixed;
    bottom: 0; 
    left: 0;
    height: 35px;
    width: 100%;
    font-size: 12px;
    background-color: black;
    padding-bottom: 25px;
    padding-left: 0;
    list-style-type: none;
    text-decoration: none;
    text-align:center;
    letter-spacing:2px;
    float: none;
}

ul li {
    display: inline;
    background:url('images/sep.svg') no-repeat top left;
     padding-left: 10px
}

a {
    text-decoration: none;
    list-style-type: none;
    color: #DFC184;
    a:visited: blue;
}

http://jsfiddle.net/EHXxS/ http://jsfiddle.net/EHXxS/embedded/result/

【问题讨论】:

    标签: html css margin spacing


    【解决方案1】:
    #nav {
        padding:0;
    }
    

    似乎可以解决它。 jsFiddle example

    【讨论】:

    • 太棒了!谢谢。似乎 ul 有一个固有的边界?
    • 是的,默认情况下<ul> 有填充。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-07
    • 1970-01-01
    • 2021-11-17
    • 2011-07-12
    • 2015-07-17
    • 2014-01-14
    相关资源
    最近更新 更多