【发布时间】:2017-11-29 22:03:34
【问题描述】:
我今天在创建导航栏时遇到了一个问题,我发现屏幕和导航栏之间有一个空间, here's what I'm talking about
我想要全宽的导航栏,完全没有空间,我尝试使用宽度width: 100%,但没有成功。
代码如下:
ul {
list-style-type: none;
margin: 0;
padding: 0;
background-color: #141414;
height: 80px;
border-radius: 5px;
}
li {
float: right;
display:inline;
list-style-type:none;
}
li a {
font-family: Julius Sans One, Arial;
font-size: 19px;
display: block;
color: white;
text-align: center;
padding: 30px 20px;
text-decoration: none;
}
.logoimg {
height: auto;
margin-left: 150px;
margin-top: 5px;
}
.left {
float: left;
}
<div>
<ul>
<li class="left"><img class="logoimg" src="/images/logo.png"></li>
<li><a>Test 1</a></li>
<li><a>Test 2</a></li>
</ul>
</div>
【问题讨论】: