如何创建多层 HTML 嵌套列表

问题描述 投票:0回答:2

如何创建这样的嵌套列表?

html html-lists
2个回答
1
投票

嵌套

ol
或/和
ul
元素。

<ol>
  <li>hi</li>
  <ol type="I">
    <li>Hi</li>
    <ol type="a">
      <li>hi</li>
    </ol>
    <li>Hi</li>
    <li>Ect.</li>
  </ol>
</ol>


-1
投票
<html>
<head>
  <title>Document</title>
</head>
<body>
  <h1>Preceding Text</h1>
<ol type="I">
  <li>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;List Item 1
    <ol type="a">
      <li>Nested Item 1.1</li>
      <li>Nested Item 1.2</li>
    </ol>
  </li>
  <br>
  <li>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;List Item 2
  
  <ol>
    <li>Nested Item 2.1</li>
    <li>Nested Item 2.2</li>
    <ul type="circle">
      <li>Nested Item 2.2.1</li>
      <li>Nested Item 2.2.2</li>
      <ul>
          <li>Nested Item 2.2.2.1</li>
          <li>Nested Item 2.2.2.2</li>
      </ul>
      <li>Nested Item 2.2.3</li>
  </ul>
  <li>Nested Item 2.3</li>
  <br>
  </ol>
  <li>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;List Item 3
        <ul>
            <li>Nested Item 3.1</li>
            <li>Nested Item 3.2</li>
            <li>Nested Item 3.3</li>
        </ul>
  </ul></li>
</ol>
</body>
</html>
© www.soinside.com 2019 - 2024. All rights reserved.