logo

该视频仅会员有权观看

立即开通课程「Web前端页面基础」权限。

¥
199
/ 年

列表元素(<ul>, <ol>, <li>)

  • ul stands for an unordered list, which is a list without numbers, and you can use the li (list item) tag to add items to it.
  • An example given includes adding items "框架" and "应用" to an unordered list, which will display with default bullet points.
  • ol represents an ordered list, which comes with sequence numbers. Ordered lists can be nested within unordered lists.
  • Items are added to ordered lists using the li tag, and examples of items are "工具," "环境," and "语言," which will display with default numbering.
  • Within an ordered list, another nested list can include items such as "命令行," "编辑器," and "版本控制."
  • Custom styles for lists can be defined in CSS. For instance:
    • li selector can be used to set the list-style-type to square or circle to change bullet styles for an unordered list.
    • ul li selector can change the list item style, like setting list-style to none to remove bullets or setting them to circles.
    • ol li selector can be used to style ordered lists, including adding leading zeros (list-style-type: decimal-leading-zero) or changing the list markers to uppercase Roman numerals (list-style-type: upper-roman).
  • Styles can also set margins and other properties, enhancing the list's appearance.