我遇到了一些问题:
我有一个页脚,里面有文字和Facebook图片。 出于某种原因,我无法直接在文本右侧获得Facebook图标。
有人可以帮帮我吗?
<div id="footerwrap">
<div id="footer">
<div class="copyright">2014 - 2015 <span class="bar">|</span>www.website.com<span class="bar">|</span>Created by <a href="http://www.website.com" target="_blank">website</a><span class="bar">|</span>
<ul>
<li><a href="https://www.facebook.com" target="_blank" title="Facebook"><img src="http://www.commuwise.nl/wp-content/uploads/facebook.png" /></a>
</li>
</ul>Like us on Facebook!</div>
</div>
</div>
和css:
#footerwrap {
width: 1000px;
float: left;
margin: 0 auto;
clear: both;
}
#footer {
height: 30px;
background: #33FF66;
border-radius: 10px;
border: 1px solid #1feb52;
margin: 0px auto;
text-align: center;
color:#FFF;
}
#footer a {
color:#FFF;
text-decoration:none;
}
#footer a:hover {
color:#FFF;
text-decoration:underline;
}
#footer a:visited {
color:#FFF;
text-decoration:underline;
}
.bar {
font-size: 15px;
}
#footer .copyright ul {
list-style: none;
margin: 0px 0px 0px;
padding: 3px;
float:right;
margin-left:5px;
}
#footer .copyright img {
border: 0px;
}
#footer .copyright {
color: #fff;
line-height: 32px;
margin-left: 5px;
margin-top: 0px;
text-align: center;
}
谢谢! 最好的问候
答案 0 :(得分:0)
这是一个js.fiddle:http://jsfiddle.net/DSrn4/1/
在你的css代码中,
#footer .copyright ul {
list-style: none;
margin: 0px 0px 0px;
padding: 3px;
display:inline-block;
margin-left:5px;
}
删除:float:right; 添加:display:inline-block;
答案 1 :(得分:0)
<div id="footerwrap">
<div id="footer">
<div class="copyright">
2014 - 2015 <span class="bar">|</span>www.website.com<span class="bar">|</span>Created by <a href="http://www.website.com" target="_blank">website</a><span class="bar">|</span>Like us on Facebook!<a href="https://www.facebook.com" target="_blank" title="Facebook"><img src="http://www.commuwise.nl/wp-content/uploads/facebook.png" /></a>
</div>
</div>
</div>
答案 2 :(得分:0)
这是你想要的吗? Working Fiddle
#footer .copyright ul {
list-style: none;
margin: 0px 5px;
padding:0 3px;
float:right;
}
#footer .copyright ul li a{
display:block;
margin:0;
padding:0;
}
#footer .copyright ul li a img{
display:inline-block;
vertical-align:top;
padding-top:3px;
}