我两天前才开始使用 HTML/CSS。请放轻松。我目前正在建立一个网站。出于某种原因,我无法让 HTML 类/ID 用 CSS 呈现。为了使它起作用,我必须为每个列表创建一个类。我怎样才能使 ul 成为一个整体?(当我拿出 时<li class="name_here>
,所有样式都不再起作用了)
HTML
<div>
<ul class="navi">
<li class="navi"><a href="http://www.bestfoodservice.us/product"><img src="../images/bestfoodservicesweb_07.jpg" width="104" height="67" /></a>
<a href="http://www.bestfoodservice.us/company"><img src="../images/bestfoodservicesweb_09.jpg" width="105" height="67" /></a>
<a href="http://www.bestfoodservice.us/facility"><img src="../images/bestfoodservicesweb_11.jpg" width="110" height="67" /></a>
<a href="http://www.bestfoodservice.us/careers"><img src="../images/bestfoodservicesweb_13.jpg" width="105" height="66" /></a></li>
</ul>
</div>
<div>
<div>
<ul class="lastbit">
<li><img src="../images/bestfoodservicesweb_34.jpg" width="85" height="29"/></li>
<li><a href="#"><img src="../images/bestfoodservicesweb_37.jpg" width="62" height="16" /></a></li>
<li><a href="#"><img src="../images/bestfoodservicesweb_38.jpg" width="69" height="16" /></a></li>
<li><a href="#"><img src="../images/bestfoodservicesweb_39.jpg" width="100" height="16" /></a></li>
</ul>
<ul class="lang">
<li class="lang"><a href="#"><img src="../images/bestfoodservicesweb_41.jpg" width="29" height="14" /></a></li>
<li class="lang"><a href="#"><img src="../images/bestfoodservicesweb_43.jpg" width="39" height="17" /></a></li>
</ul>
<ul class="social">
<li class="social"><a href="http://facebook.com"><img src="../images/bestfoodservicesweb_27.jpg" width="30" height="29" /></a></li>
<li class="social"><a href="http://twitter.com"><img src="../images/bestfoodservicesweb_29.jpg" width="30" height="29" /></a></li>
<li class="social"><a href="http://linkedin.com"><img src="../images/bestfoodservicesweb_31.jpg" width="30" height="29" /></a></li>
</ul>
</div>
</div>
CSS
.navi {
list-style: none;
display: inline;
margin-left: 5px;
position: relative;
top: 5px;
}
.lastbit {
list-style: none;
display: inline-block;
}
.lang {
list-style: none;
display: inline;
}
.social {
list-style: none;
display: inline;
}