關於CSS中list-style修改列表屬性控制li標籤樣式的問題

來源:互聯網
上載者:User
這篇文章主要介紹了關於CSS中list-style修改列表屬性控制li標籤樣式的問題,有著一定的參考價值,現在分享給大家,有需要的朋友可以參考一下

list_style屬性用於修改列表的屬性,list-style-type用於設定清單項目類型,list-style-position用於設這清單項目位置,list-style-image用於設定使用映像其他清單項標記

list_style屬性用於修改列表的屬性

格式如下:
list_style:清單項目標記類型 清單項目標記的位置 清單項目標記;
也可以單獨設定清單項目標記:
list-style-type用於設定清單項目類型:
預設值為disc為實心圓,
常用值:none空
circle空心圓
square實心方塊
decimal數字
lower-latin小寫拉丁字母a,b,c.....
upper-latin大寫字母A,B,C....
list-style-position用於設這清單項目位置:
預設值outside表示在li標籤外部,這是對li添加邊框border:1px solid red;可以看到標記的位置。
inside表示標記在li標籤裡面,同樣添加邊框時可以清晰地看到。
list-style-image用於設定使用映像其他清單項標記:
預設值:none
可選值:URL ,格式為url("url地址");
舉例:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>無標題文檔</title> <style type="text/css"> ul { border:1px solid red; } li{ border:1px solid red; list-style:disc outside url(news_list.gif); list-style-position:5px; } </style> </head> <ul> <li>你好</li> <li>我好</li> </ul> <body> </body> </html>

規定一個 "list-style-type" 屬性以防映像不可用。

以上就是本文的全部內容,希望對大家的學習有所協助,更多相關內容請關注topic.alibabacloud.com!

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.