我想使用一些圖標作爲鏈接,並在每個鏈接下面都有文字鏈接,但我似乎無法弄清楚如何做到這一點。所以每個圖標和文本鏈接都可以工作 鏈接到jsfiddle:http://jsfiddle.net/huwrowlands/jvMfY/CSS Sprites and Anchors
有人可以顯示我的方式錯誤。
在此先感謝
<ul class="i-icons">
<li class="i-icon-va tablet-grid-33 mobile-grid-50"><a href="#">Vehicle Accidents</a></li>
<li class="i-icon-pi tablet-grid-33 mobile-grid-50"><a href="#">Personal Injury</a></li>
</ul>
#homepage-header ul.i-icons {
list-style-type: none;
padding: 0;
margin: 0;
width: 100%;
text-align: center;
}
#homepage-header ul.i-icons li {
/*text-indent: -9999em;*/
display: inline-block;
width: 140px;
height: 140px;
background-image: url('http://inspiredworx-labs.com/sites/injury-icons.png');
background-repeat: no-repeat;
position: relative;
margin: 10px 10px 20px 10px;
}
#homepage-header ul.i-icons li.i-icon-va {
background-position: 0 -1px;
}
#homepage-header ul.i-icons li.i-icon-pi {
background-position: -155px -1px;
}
#homepage-header ul.i-icons li a {
display: block;
width: 100%;
height: 100%;
position: relative;
color: #fff;
font-size: 14px;
font-size: 1.4rem;
text-decoration: none;
}
你能澄清你需要什麼嗎?你是說你想讓文字置於圖標下方而不是頂部?或者是其他東西?你的問題不清楚 – samrap
如果我的問題不清楚,道歉。我希望文本在下面。 –