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

王林
發布: 2023-09-03 12:09:04
轉載
1405 人瀏覽過

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

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
            熱門教學
            更多>
            最新下載
            更多>
            網站特效
            網站源碼
            網站素材
            前端模板
            關於我們 免責聲明 Sitemap
            PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!