[英]Images won't show in footer
我要在页脚中添加2个社交媒体图像。 它们在我的图像地图中,包括正确的等内容,但似乎无法弄清楚为什么它们不显示?
尝试了很多,但确实无法解决问题。与固定在我网站上的页脚有关吗? 我真的不知道
码:
<div id="footer">
<div id="social">
<p>test</p>
<div class="facebook"><a href="" title="Facebook Page"></a></div>
<div class="twitter"><a href="" title="Twitter"></a></div>
</div>
<p>Copyright © 2013 . All rights reserved.</p>
</div>
CSS:
#social {
text-align: center;
}
.facebook a {
height: 33px;
width: 33px;
background-image: url('images/facebook.png');
background-repeat: no-repeat;
}
.facebook a:hover {
background-image: url('images/facebookhover.png');
background-repeat: no-repeat;
}
.twitter a {
height: 33px;
width: 33px;
background-image: url('images/twitter.png');
background-repeat: no-repeat;
}
.twitter a:hover {
background-image: url('images/twitterhover.png');
background-repeat: no-repeat;
}
/* Footer */
#footer {
padding: 5px;
position: fixed;
bottom: 0;
left: 0;
width: 100%;
margin: 0;
background: #333;
color: #FFF;
}
#footer p {
text-align: center;
margin: 0;
}
#footer a {
color: #fff;
}
这是jsfiddle上的示例: http : //jsfiddle.net/mwx5q/
在.facebook a
和.twitter a
使用display block
样式
请检查,我已经更新了您的jsFiddle文件,您可以根据您的设计更改css。
您的url
路径可能有问题。
也许尝试../images/twitter.png
和../images/twitterhover.png
这将备份一个文件夹。 如果CSS位于其自己的文件夹中,则很有用,您必须备份到根目录,然后进入images
。
希望这可以帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.