2016-11-20 64 views
0

通常我堅持要爲移動版本做適當的菜單。我的問題是左側列表中不需要的填充(可以看到填充的左下邊框),我很難找到這個錯誤。感謝您的答案,這裏是代碼:李列表菜單不需要的左側空間

<nav> 
<div id="menubar"> 
    <a href="#" id="menu-icon"></a> 
    <ul> 
    <li><a href="#">Test 1</a></li> 
    <li><a href="#">Test 2</a></li> 
    <li><a href="#">Test 3</a></li> 
    <li><a href="#">Test 4</a></li> 
    </ul> 
</div> 

CSS:

#menu-icon { 
    display:inline-block; 
    width: 40px; 
    height: 40px; 
    float: right; 
    background: #364886 url(../Images/Interface/menu-icon.png) center; 
    } 
#menubar { 
    position: relative; 
    } 
ul { 
    list-style:none; 
    } 
ul a:visited, 
ul a:link, 
ul a:hover { 
    text-decoration: none; 
    color: white; 
    } 
nav ul, nav:active ul { 
    width: 90%; 
    display: none; 
    position: absolute; 
    background: #364886; 
    font-family: 'Roboto', sans-serif; 
    font-size: 12pt; 
    color: white; 
    right: 0px; 
    top: 24px; 
    } 
nav li { 
    text-align: center; 
    width: 100%; 
    padding: 10px 10px 10px 10px; /* top-right-bottom-left*/ 
    margin: 0; 
    border-bottom: 1px dotted white; 
    box-sizing: border-box; 
    -moz-box-sizing: border-box; 
    -webkit-box-sizing: border-box; 
    } 
nav:hover ul { 
    display: block; 
    } 
+0

請點擊編輯器中的<<按鈕>,然後創建一個片段 – mplungjan

回答

1

添加填充:0在UL UL { 列表樣式:無; 填充:0; }

+0

這很棒,很有效,我以爲我嘗試了一切。非常感謝。通常這個問題已經解決了。 – Igor

+0

歡迎伴侶:) – jafarbtech

相關問題