我試圖將整個鏈接居中並且我正在努力尋找解決方案。我爲我的鏈接使用簡單的推拉門風格,我希望它是中心。使用滑動門的中心鏈接CSS
這裏你可以與互動演示:http://jsbin.com/ibidu3
<style>
a.btn_blue {
background:url("http://img291.imageshack.us/img291/2600/btnblueleft.gif") no-repeat scroll left top transparent;
float:left;
text-decoration:none;
margin-right:4px;
padding-left:5px;
color:#fff;
}
a.btn_blue span{
background:url("http://img826.imageshack.us/img826/1531/btnblueright.gif") no-repeat scroll right top transparent;
float:left;
padding:6px 10px 10px 4px;
}
</style>
<a href="#" class="btn_blue"><span>Learn More: <strong>Benefits</strong></span></a>
「滑門」是指什麼? – Ryan 2010-10-03 00:58:24
@Ryan,他指的是'無限擴展'背景的CSS方法(因此文本可以在不破壞網站設計的情況下進行縮放),[A List Apart]上有一篇文章(http://www.alistapart.com/articles/slidingdoors /)解釋它。 – 2010-10-03 01:08:40
@Evan,你有沒有選擇走滑門的原因,而不是使用'background-colour',css-gradients,'border-radius' ..?你的'btn_blue'似乎非常脆弱,並且持久。 – 2010-10-03 01:19:34