我对CSS并不陌生,但是我一直在尝试找出样式表中的错误。
我已将ul的li元素设置为样式,但最后一项始终不符合要求。我想要的是<li>
项,以自动填充div宽度而没有填充或行外内容。更改我的图标大小无效。请帮帮我
ul {
position: absolute;
text-align: center;
bottom: 0%;
left: 0px;
transform: translate(-50%, -50%) margin: 0;
padding: 3px 0;
background: #FFF;
display: flex;
width: auto;
}
ul li {
list-style: none;
text-align: center;
float: right;
width: 100%;
border-right: 1px solid rgba(0, 0, 0, .2);
}
ul li a {
text-decoration: none;
display: block;
padding: 0 20px;
}
ul li a .icon {
width: 30px;
height: 30px;
text-align: center;
overflow: hidden;
margin: 0 auto 10px;
}
ul li a .icon .fa {
width: 100%;
height: 100%;
line-height: 35px;
font-size: 24px;
transition: 0.5s;
color: #F60;
}
<!-- Start of first page -->
<div data-role="page" id="foo">
<div data-role="header">
<h1>Home</h1>
</div>
<!-- /header -->
<div role="main" class="ui-content">
<p>Welcome to Home</p>
<p>Click here to go to <a href="#bar">Category</a> Page</p>
</div>
<!-- /content -->
<div data-role="footer" data-position="fixed" style="background-color:transparent; border:none" class="">
<div data-role="navbar" data-grid="d" class="ui-table">
<ul>
<li>
<a href="#foo" class="ui-btn-active ui-state-persist">
<div class="icon"><i class="fa fa-home" aria-hidden="true" class="ui-btn-active"></i></div>
<div class="name" data-text="Home">Home</div>
</a>
</li>
<li>
<a href="#bar">
<div class="icon"><i class="fa fa-folder-open" aria-hidden="true"></i></div>
<div class="name" data-text="Category">Category</div>
</a>
</li>
<li>
<a href="#">
<div class="icon"><i class="fa fa-phone-square" aria-hidden="true"></i></div>
<div class="name" data-text="Call">Call</div>
</a>
</li>
<li>
<a href="#">
<div class="icon"><i class="fa fa-comments" aria-hidden="true"></i></div>
<div class="name" data-text="Chat">Chat</div>
</a>
</li>
<li>
<a href="#">
<div class="icon"><i class="fa fa-question-circle" aria-hidden="true"></i></div>
<div class="name" data-text="Help">Help</div>
</a>
</li>
</ul>
</div>
<!-- /footer -->
</div>
</div>
我不知道如何在此处添加图像,我会在屏幕上截图。 显示器还可以,但是最后一个项目始终与其他项目不符。我不知道如何解决这个问题