首頁  >  文章  >  web前端  >  如何在HTML中建立一個有序列表,其中列表項目使用大寫羅馬數字編號?

如何在HTML中建立一個有序列表,其中列表項目使用大寫羅馬數字編號?

王林
王林轉載
2023-09-03 12:09:041397瀏覽

有序列表是一組有編號的項目。它使您能夠在上下文中控制序號。允許我們將一組相關的項目分組在清單中。

HTML support ordered list, unordered list and we have to use the

    tag, to create ordered list in HTML. The
      tag defines the ordered list. We use
    1. tag to start list of items. The list of items can be marked as numbers, lowercase letters uppercase letters, roman letters, etc.

      #預設順序是在上下文中對清單項目進行編號。

      • The

      • tag should be placed inside the
          tag to create the list of items.

        1. We use type attribute of the

            tag, for creating an ordered list with numbers.

          1. We can also use

              to create ordered list numbered with uppercase roman numbers.

              如何在HTML中建立一個有序列表,其中列表項目使用大寫羅馬數字編號?

            ##

            Syntax

            Following is the syntax to create an ordered list items numbered with uppercase roman numbers in HTML.

            <ol type="A">
               <li>Item in list…</li>
               <li>Item in list…</li>
               <li>Item in list…</li>
            </ol>
            

            Example 1

            給出以下是一個在HTML中建立使用大寫羅馬數字編號的有序清單項目的範例。

            <!DOCTYPE html>
            <html>
            <head>
               <meta charset="UTF-8">
               <meta http-equiv="X-UA-Compatible" content="IE=edge">
               <meta name="viewport" content="width=device-width, initial-scale=1.0">
            </head>
            <body>
               <ol type="I">
                  <li>Abdul</li>
                  <li>Jason</li>
                  <li>Yadav</li>
                  <li>Lokesh</li>
               </ol>
            </body>
            </html>
            

            以下是上述範例程式的輸出。

            Example 2

            Let us look at another example to create an ordered list with uppercase roman numbers as bullets −

            #
            <!DOCTYPE html>
            <html>
            <head>
               <title>World Cup Teams</title>
            </head>
            <body>
               <h1>List of teams for World Cup</h1>
               <ol type = "I">
                  <li>India</li>
                  <li>Australia</li>
                  <li>South Africa</li>
                  <li>New Zealand</li>
                  <li>Pakistan</li>
                  <li>Srilanka</li>
                  <li>West Indies</li>
                  <li>Bangladesh</li>
               </ol>
            </body>
            </html>
            
            ###在實作上述HTML程式碼後,輸出結果如下 -###

            以上是如何在HTML中建立一個有序列表,其中列表項目使用大寫羅馬數字編號?的詳細內容。更多資訊請關注PHP中文網其他相關文章!

          2. 陳述:
            本文轉載於:tutorialspoint.com。如有侵權,請聯絡admin@php.cn刪除