亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

directory search
Attributes accesskey (attribute) class (attribute) contenteditable (attribute) contextmenu (attribute) data-* (attribute) dir (attribute) draggable (attribute) dropzone (attribute) Global attributes hidden (attribute) id (attribute) itemid (attribute) itemprop (attribute) itemref (attribute) itemscope (attribute) itemtype (attribute) lang (attribute) slot (attribute) spellcheck (attribute) style (attribute) tabindex (attribute) title (attribute) translate (attribute) Elements a abbr address area article aside audio b base bdi bdo blockquote body br button canvas caption cite code col colgroup data datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 head header hr html i iframe img input input type="button" input type="checkbox" input type="color" input type="date" input type="datetime"-local input type="email" input type="file" input type="hidden" input type="image" input type="month" input type="number" input type="password" input type="radio" input type="range" input type="reset" input type="search" input type="submit" input type="tel" input type="text" input type="time" input type="url" input type="week" ins kbd label legend li link main map mark menu menuitem meta meter nav noscript object ol optgroup option output p param picture pre progress q rp rt rtc ruby s samp script section select slot small source span strong style sub summary sup table tbody td template textarea tfoot th thead time title tr track u ul var video wbr Miscellaneous Attributes Block-level elements CORS enabled image CORS settings attributes Element Inline elements Kinds of HTML content Link types Microdata Optimizing your pages for speculative parsing Preloading content Reference Supported media formats Using the application cache Obsolete acronym applet basefont big blink center command content dir element font frame frameset hgroup image input type="datetime" isindex keygen listing marquee nextid noframes plaintext strike tt xmp
characters

HTML <ol>元素代表項(xiàng)目,通常呈現(xiàn)為編號(hào)列表的有序列表。

內(nèi)容類別

Flow content, and if the <ol> element's children include at least one <li> element, palpable content.

允許的內(nèi)容

一個(gè)或多個(gè)<li>元素。這些<li>元素可以再包含嵌套的<ol><ul>元素。

標(biāo)簽省略

不允許,開始標(biāo)簽和結(jié)束標(biāo)簽都不能省略。

允許的父元素

Any element that accepts flow content.

允許的 ARIA 角色

directory, group, listbox, menu, menubar, radiogroup, tablist, toolbar, tree, presentation

DOM 接口

HTMLOListElement

屬性

這個(gè)元素包含全局屬性。

compact 這個(gè)布爾屬性暗示列表應(yīng)該以緊湊的風(fēng)格呈現(xiàn)。該屬性的解釋取決于用戶代理,并且不適用于所有瀏覽器。

注: 不要使用這個(gè)屬性,這個(gè)屬性已經(jīng)過時(shí):<ol>元素的樣式應(yīng)當(dāng)使用CSS 來控制,想要獲得和這個(gè)屬性相似的效果,使用 CSS 屬性 line-height并設(shè)置值為 80%。

reversed HTML5 這個(gè)布爾屬性規(guī)定了列表的條目采用倒序,即最不重要的條目放在列表第一個(gè)位置。

start HTML5 這是整數(shù)屬性,規(guī)定了列表得條目序號(hào)的開始的值。盡管列表?xiàng)l目的序號(hào)可能是羅馬字母順序,如 XXXI, 或者字母,這個(gè)開始的順序總是使用數(shù)字表示。比如想要元素序號(hào)從字母 “C” 開始,使用 <ol start="3">。

注:這個(gè)屬性在 HTML4 中棄用,但是在 HTML5 中被重新引入。

type 指示編號(hào)類型:

  • 'a'表示小寫字母編號(hào),

  • 'A' 表示大寫字母編號(hào),

  • 'i' 表示小寫羅馬數(shù)字編號(hào),

  • 'I' 表示大寫羅馬數(shù)字編號(hào),

  • '1' 表示數(shù)字編號(hào)(默認(rèn)值)。

這個(gè)類型集用于整個(gè)列表,除非type在封閉<li>元素中使用了不同的屬性。

注意:此屬性在 HTML4 中已被棄用,但在 HTML5 中重新引入。除非清單號(hào)碼的價(jià)值很重要(例如,在法律或技術(shù)文件中的項(xiàng)目將通過其號(hào)碼/字母引用),則list-style-type應(yīng)該使用 CSS 屬性。

使用說明

  • 通常,有序列表?xiàng)l目和它前面的編號(hào)一起顯示,它的編號(hào)可以是任何形式,如數(shù)字、字母或者羅馬數(shù)字,甚至可以是小子彈。而這種樣式(小子彈)并沒有在 HTML 頁面內(nèi)定義,而是在其關(guān)聯(lián)的 CSS 中,使用了 list-style-type 屬性。

  • HTML 并沒有對 <ol><ul> 元素的深度和反復(fù)使用次數(shù)(overlap)作出限制。

  • <ol><ul> 都是列表項(xiàng)。它們的不同點(diǎn)在于 <ol> 元素里條目的順序是有意義的。 對于該選擇哪一個(gè)去使用下面有個(gè)建議:嘗試去更改列表項(xiàng)的順序,如果其含義改變了,那么應(yīng)該使用 <ol> 元素,否則使用 <ul> 更合適。

示例

簡單示例

<ol>  
    <li>first item</li>  
    <li>second item</li>  
    <li>third item</li>
</ol>

在 HTML 上方輸出:

  1. first item

  2. second item

  3. third item

使用羅馬數(shù)字類型

<ol type="i">  
    <li>foo</li>  
    <li>bar</li>  
    <li>spam</li>
</ol>

上面的 HTML 將輸出

i. foo

ii. bar

iii. spam

使用start屬性

<ol start="7">  
    <li>first item</li>  
    <li>second item</li>  
    <li>third item</li>
</ol>

在 HTML 上方輸出:

  1. first item

  2. second item

  3. third item

嵌套列表

<ol>  
    <li>first item</li>  
    <li>second item  <!-- closing </li> tag not here! -->    
        <ol>      
            <li>second item first subitem</li>      
            <li>second item second subitem</li>      
            <li>second item third subitem</li>    
        </ol>  
    </li><!-- Here's the closing </li> tag -->  
    <li>third item</li>
</ol>

在 HTML 上方輸出:

  1. first item

  2. second item

    1. second item first subitem

    2. second item second subitem

    3. second item third subitem

  3. third item

嵌套 <ol> 和 <ul>

<ol>  
    <li>first item</li>  
    <li>second item  <!-- closing </li> tag not here! -->    
        <ul>      
            <li>second item first subitem</li>      
            <li>second item second subitem</li>      
            <li>second item third subitem</li>    
        </ul>  
    </li><!-- Here's the closing </li> tag -->  
    <li>third item</li>
</ol>

在 HTML 上方輸出:

  1. first item

  2. second item

    • second item first subitem

    • second item second subitem

    • second item third subitem

  3. third item

規(guī)范

Specification

Status

Comment

HTML Living StandardThe definition of '<ol>' in that specification.

Living Standard

No change since last W3C snapshot, HTML5.

HTML5The definition of 'HTMLOListElement' in that specification.

Recommendation

Added reversed and start attributed; un-deprecated type

HTML 4.01 SpecificationThe definition of '<ol>' in that specification.

Recommendation

Deprecated compact and type.

瀏覽器兼容性

Feature

Chrome

Edge

Firefox

Internet Explorer

Opera

Safari

Basic Support

(Yes)

(Yes)

1

(Yes)

(Yes)

(Yes)

compact

(Yes)

(Yes)

1

(Yes)

(Yes)

(Yes)

reversed

18

?

18

No

(Yes)

5.2

start

(Yes)

(Yes)

1

(Yes)

(Yes)

(Yes)

type

(Yes)

(Yes)

1

(Yes)

(Yes)

(Yes)

Feature

Android

Chrome for Android

Edge mobile

Firefox for Android

IE mobile

Opera Android

iOS Safari

Basic Support

(Yes)

(Yes)

(Yes)

1

(Yes)

(Yes)

(Yes)

compact

(Yes)

(Yes)

(Yes)

1

(Yes)

(Yes)

(Yes)

reversed

(Yes)

(Yes)

?

18

No

(Yes)

(Yes)

start

(Yes)

(Yes)

(Yes)

1

(Yes)

(Yes)

(Yes)

type

(Yes)

(Yes)

(Yes)

1

(Yes)

(Yes)

(Yes)

Previous article: Next article: