爲了創建四捨五入的按鈕,我使用了三幅圖像:左圖像,右圖像和一條圖像。每個工作都很好,但在safari和鉻合適的圖像進入下一行,我不明白爲什麼會發生這種情況。所以有人請幫助我, 這裏是html標記和它的CSS。鉻和狩獵中的圓形按鈕中斷
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
body{width: 980px;margin: 0 auto}
.light_button a {background:url("images/center.png") repeat-x scroll 0 0 transparent;color:#000000;display:inline-block;font-size:16px;font-weight:bold;height:34px;line-height:29px;position:relative;text-align:center;text-decoration:none;}
.light_button .lout {background:url("images/left.png") no-repeat scroll 0 0 transparent;float:left;height:31px;left:-8px;position:absolute;width:8px;}
.light_button .rout {background:url("images/right.png") no-repeat scroll 0 0 transparent;float:right;height:31px;position:absolute;width:26px;}
.light_button a.light_right_nav_first {background:url("images/center.png") repeat-x scroll 0 0 transparent;color:#000;display:inline-block;font-size:16px;font-weight:bold;height:31px;line-height:29px;position:relative;text-align:center;text-decoration:none;}
.light_button a.light_right_nav_first .lout {background:url("images/p_left.png") no-repeat scroll 0 0 transparent;float:left;height:31px;left:-24px;position:absolute;width:24px;}
.light_button a.light_right_nav_first .rout {background:url("images/r_right.png") no-repeat scroll 0 0 transparent;float:right;height:31px;position:absolute;width:26px;}
</style>
</head>
<body>
<div class="light_button">
<div class="left">
<a class="nav_first" href="#">
<span class="lout"></span>
home
<span class="rout"></span>
</a>
</div>
<div class="right">
<a class="light_right_nav_first" href="#">
<span class="lout"></span>
home
<span class="rout"></span>
</a>
</div>
</div>
</body>
</html>
如果您需要圓角按鈕,爲什麼不嘗試'border-radius' CSS3屬性?它比你在這裏工作的方法更容易,也更簡單。 – 2010-08-14 05:38:58
是的,我知道,但正確的形象有兩個圖像的組合 – Soarabh 2010-08-14 05:57:13