li{
list-style-image:url(images/XXX.gif);
}
如果在li中定義list-style-image,只有FireFox沒有問題,IE8會造成項目圖示與項目文字不對齊,Google Chrome 9.0會造成圖示遺失,唯一比較好的方法是把該項目圖示設定為背景圖案,利用pading的方式解決。
li{
clear:inherit;
margin:0;
width:80px;
float:left; /*讓條例項目呈現水平排列*/
background-image:url(images/XXX.gif);
background-repeat:no-repeat;
background-position:left;
padding-left:10px;
list-style-type:none; /*去除項目符號*/
}
參考網站:
1.
list-style-image (CSS property)http://reference.sitepoint.com/css/list-style-image
2. CSS ul li image to align with text
3. Tutorial 1 - Background images for bullets - all steps combined
http://css.maxdesign.com.au/listutorial/master.htm
沒有留言:
張貼留言