CSSlist-style-type屬性的使用方法

本篇內(nèi)容介紹了“CSS list-style-type屬性的使用方法”的有關(guān)知識,在實際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領(lǐng)大家學習一下如何處理這些情況吧!希望大家仔細閱讀,能夠?qū)W有所成!

網(wǎng)站建設(shè)哪家好,找創(chuàng)新互聯(lián)!專注于網(wǎng)頁設(shè)計、網(wǎng)站建設(shè)、微信開發(fā)、成都微信小程序、集團企業(yè)網(wǎng)站建設(shè)等服務項目。為回饋新老客戶創(chuàng)新互聯(lián)還提供了邱縣免費建站歡迎大家使用!

設(shè)置對象的行項標記的預定義類型。

語法
{ list-style-type: sType }

可能的值
sType

一個字符串,用于指定以下值之一:

disc

默認值。實心圓。

circle

空心圓。

decimal

1、2、3、4 等等。

lower-alpha

a、b、c、d 等等。

lower-roman

i、ii、iii、iv 等等。

none

不顯示任何標記。

square

實心正方形。

upper-alpha

A、B、C、D 等等。

upper-roman

I、II、III、IV 等等。

該屬性的默認值為 disc。該屬性會被繼承。

注解

如果 list-style-image 屬性的值設(shè)置為 none ,或者無法顯示 URL 指向的圖像,則 list-style-type 屬性決定 list-item 標記的外觀。

list-style-type 屬性可在應用 margin 和 display:list-item 屬性之后應用于任何元素。

如果使用其中一個 margin 屬性將行項的左邊距設(shè)置為 0,則不會顯示列表項標記。該邊距至少應設(shè)置為 30 磅。

示例
下面的示例使用 list-style-type 屬性設(shè)置標記。本示例在內(nèi)嵌(全局)樣式表中使用 UL 元素作為選擇器,以將標記類型更改為 circle :

代碼如下:


<style>
ul {list-style-type:circle}
</style>



list-style-type -- 定義列表樣式

取值:disc | circle | square | decimal | decimal-leading-zero | lower-roman | upper-roman | lower-greek | lower-latin | upper-latin | armenian | georgian | lower-alpha | upper-alpha | none | inherit
disc: 點
circle: 圓圈
square: 正方形
decimal: 數(shù)字
decimal-leading-zero: 十進制數(shù),不足兩位的補齊前導0,例如: 01, 02, 03, ..., 98, 99
lower-roman: 小寫羅馬文字,例如: i, ii, iii, iv, v, ...
upper-roman: 大寫羅馬文字,例如: I, II, III, IV, V, ...
lower-greek: 小寫希臘字母,例如: &alpha;(alpha), &beta;(beta), &gamma;(gamma), ...
lower-latin: 小寫拉丁文,例如: a, b, c, ... z
upper-latin: 大寫拉丁文,例如: A, B, C, ... Z
armenian: 亞美尼亞數(shù)字
georgian: 喬治亞數(shù)字,例如: an, ban, gan, ..., he, tan, in, in-an, ...
lower-alpha: 小寫拉丁文,例如: a, b, c, ... z
upper-alpha: 大寫拉丁文,例如: A, B, C, ... Z
none: 無(取消所有的list樣式)
inherit:繼承

初始值: disc
繼承性: 是
適用于: 所有屬于list的元素
list,中文"列表"的意思.style,中文"樣式"的意思.type,中文"類型"的意思.

示例

CSS Code復制內(nèi)容到剪貼板

  1. ul    

  2. {    

  3.     list-style-type:disc;   

  4. }   

  5.   

  6. ul#circle  

  7. {    

  8.     list-style-type:circle;   

  9. }   

  10.   

  11. ul#square  

  12. {    

  13.     list-style-type:square;   

  14. }   

  15.   

  16. ul#decimal   

  17. {    

  18.     list-style-type:decimal;   

  19. }   

  20.   

  21. ul#decimal-leading-zero   

  22. {    

  23.     list-style-type:decimal-leading-zero;   

  24. }   

  25.   

  26. ul#lower-roman   

  27. {    

  28.     list-style-type:lower-roman;   

  29. }   

  30.   

  31. ul#upper-roman   

  32. {    

  33.     list-style-type:upper-roman;   

  34. }   

  35.   

  36. ul#lower-greek   

  37. {    

  38.     list-style-type:lower-greek;   

  39. }   

  40.   

  41. ul#lower-latin   

  42. {    

  43.     list-style-type:lower-latin;   

  44. }   

  45.   

  46. ul#upper-latin   

  47. {    

  48.     list-style-type:upper-latin;   

  49. }   

  50.   

  51. ul#armenian   

  52. {    

  53.     list-style-type:armenian;   

  54. }   

  55.   

  56. ul#georgian   

  57. {    

  58.     list-style-type:georgian;   

  59. }   

  60.   

  61. ul#lower-alpha   

  62. {    

  63.     list-style-type:lower-alpha;   

  64. }   

  65.   

  66. ul#upper-alpha   

  67. {    

  68.     list-style-type:upper-alpha;   

  69. }   

  70.   

  71. ul#none  

  72. {    

  73.     list-style-type:none;   

  74. }   

  75.   

  76. ol    

  77. {    

  78.     list-style-type:lower-roman;   

  79. }   

“CSS list-style-type屬性的使用方法”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識可以關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實用文章!

當前標題:CSSlist-style-type屬性的使用方法
轉(zhuǎn)載來源:http://bm7419.com/article12/gihcgc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站收錄、標簽優(yōu)化、網(wǎng)站設(shè)計、外貿(mào)網(wǎng)站建設(shè)網(wǎng)站內(nèi)鏈、品牌網(wǎng)站制作

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都seo排名網(wǎng)站優(yōu)化