ul
{
list-style-type: none;
padding: 0px;
margin: 0px;
}
ul li
{
background-image: url(sqpurple.gif);
background-repeat: no-repeat;
background-position: 0px 5px;
padding-left: 14px;
}
-
ul:
- 設置列表樣式類型爲沒有刪除列表項標記
- 設置填充和邊距0px(瀏覽器兼容性)
-
ul中所有li:
- 設置圖像的URL,並設置它只顯示一次(無重複)
- 您需要的定位圖像位置(左0px和上下5px)
- 用padding-left屬性把文本置於列表中