css Html嵌套列表,十进制列表只打印数字1

btxsgosb  于 2023-02-06  发布在  其他
关注(0)|答案(1)|浏览(84)

我怎样才能使十进制列表从1到2在下面的代码。不能弄清楚,也许我做了一些错误的标签。请检查下面的代码。结果只打印数字1

div {
  background-color: white;
  width: 300px;
  border: 2px solid red;
  padding: 20px;
  margin: 10px;
}
ul.a {list-style-type: disc;}
ol.f {list-style-type: decimal;}
ol.u {list-style-type: upper-roman;}
ol.t {list-style-type: upper-latin;}
ol.p {list-style-type: lower-latin;}
ol.q {list-style-type: lower-roman;}
<div>
<font size="6"
          face="arial"
          color="light blue">
          Aircraft Types
    </font>
<ul class="a">
  <li>General Aviation (piston-driven engines)</li>
      <ol class="f">
        <li>Single-Engine Aircraft</li>
      </ol>
      <ul>
        <ol class="u">
        <li>Tail wheel</li>
        <li>Tricycle</li>
        </ol>
      </ul>
      <ol class="f">
        <li>Dual-Engine Aircraft</li>
      </ol>
      <ul>
      <ol class="t">
        <li>Wing-mounted engines</li>
        <li>Push-pull fuselage-mounted engines</li>
      </ol>
      <ul>
      </ul>
      </ul>

</ul>
<ul class="a">
    <li>Commercial Aviation (jet engines)</li>
      <ol class="f">
        <li>Dual Engine</li>
      </ol>
      <ul>
      <ol class="p">
        <li>Wing-mounted engines</li>
        <li>Fuselage-mounted engines</li>
      </ol>
      </ul>
      <ol class="f">
        <li>Tri-Engine</li>
      </ol>
      <ul>
      <ol class="q">
        <li>Third engine in vertical stabilizer</li>
        <li>Third engine in fuselage</li>
      </ol>
      </ul>
</ul>
</div>

我试着移出标签,但我无法理解。我想让十进制数字按升序排列。我的代码只显示1

fdx2calv

fdx2calv1#

请在下面查找具有预期结果的更正代码:

div {
  background-color: white;
  width: 300px;
  border: 2px solid red;
  padding: 20px;
  margin: 10px;
}

ul.a {
  list-style-type: disc;
}

ol.f {
  list-style-type: decimal;
}

ol.u {
  list-style-type: upper-roman;
}

ol.t {
  list-style-type: upper-latin;
}

ol.p {
  list-style-type: lower-latin;
}

ol.q {
  list-style-type: lower-roman;
}
<!DOCTYPE html>

<head>
  <link href="style.css" rel="stylesheet" type="text/css" media="all" />
</head>

<body>
  <div>
    <font size="6" face="arial" color="light blue">
      Aircraft Types
    </font>
    <ul class="a">
      <li>General Aviation (piston-driven engines)</li>
      <ol>
        <li>Single-Engine Aircraft</li>
        <ol class="u">
          <li>Tail wheel</li>
          <li>Tricycle</li>
        </ol>

        <li>Dual-Engine Aircraft</li>
        <ol class="t">
          <li>Wing-mounted engines</li>
          <li>Push-pull fuselage-mounted engines</li>
        </ol>
      </ol>
    </ul>
    <ul class="a">
      <li>Commercial Aviation (jet engines)</li>
      <ol>
        <li>Dual Engine</li>
        <ol class="p">
          <li>Wing-mounted engines</li>
          <li>Fuselage-mounted engines</li>
        </ol>
        <li>Tri-Engine</li>
        <ol class="q">
          <li>Third engine in vertical stabilizer</li>
          <li>Third engine in fuselage</li>
        </ol>
      </ol>
    </ul>
  </div>
</body>

相关问题