ul、li顯示圖片標記

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屬性把文本置於列表中
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章