使用跨瀏覽器解決方案設定一個清單項目標記的圖像
實例解析:
ul:
● 設定列表樣式類型為沒有刪除列表項目標記
● 設定填滿與邊距0px(瀏覽器相容性)
ul中所有li:
# ● 設定影像的URL,並設定它只顯示一次(無重複)
● 您需要的定位影像位置(左0px和上下5px)
● 用padding-left屬性把文字置於清單中
新建檔案
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>php中文网(php.cn)</title>
<style>
ul
{
list-style-type:none;
padding:0px;
margin:0px;
}
ul li
{
background-image:url("https://img.php.cn/upload/article/000/000/015/5c6e720242040312.gif");
background-repeat:no-repeat;
background-position:0px 5px;
padding-left:14px;
}
</style>
</head>
<body>
<ul>
<li>PHP</li>
<li>JavaScript</li>
<li>MySQl</li>
</ul>
</body>
</html>
預覽
Clear
- 課程推薦
- 課件下載
課件暫不提供下載,工作人員正在整理中,後期請多關注該課程~ 















