我試圖讓社交圖標通過CSS顯示在頁腳上。在HTML鏈接上放置背景圖片
HTML
<div class="copyright container">
<div class="sicons">
<a class="copy1" href="#"></a>
<a class="copy2" href="#"></a>
<a class="copy3" href="#"></a>
<a class="copy4" href="#"></a>
<a class="copy5" href="#"></a>
</div>
</div>
CSS
.container {
overflow: hidden;
margin: 0em auto;
width: 1000px;
}
.copyright {
overflow: hidden;
padding: 1em 0em;
border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.copyright a {
text-decoration: none;
}
.copyright img {
vertical-align: middle;
width: 70px;
height: 70px;
}
.copyright a.copy5 img {
width: 50px;
height: 50px;
}
.copyright a.copy1 {
background: url(1.png) center no-repeat;
}
.copyright a.copy2 {
background: url(2.png) center no-repeat;
}
.copyright a.copy3 {
background: url(2.png) center no-repeat;
}
.copyright a.copy4 {
background: url(4.png) center no-repeat;
}
.copyright a.copy5 {
background: url(5.png) center no-repeat;
}
的圖像不會與這樣的代碼顯示。他們會顯示當我添加
.copyright a.copy1, .copyright a.copy2, .copyright a.copy3, .copyright a.copy4, .copyright a.copy5 {
display: inline-block;
text-decoration: none;
margin:15px;
text-indent:-9999px;
width:50px;
height:50px;
}
但是,圖像出現扭曲與此代碼。我在哪裏出錯了?
不幸的是我使用的圖片都出來扭曲 –
@MaxNjoroge這是什麼意思? ..他們是不一樣的大小/寬度/高度? – LGSon
我正在使用PNG文件,圖像即將放大 –