学习HTML(六)——<body>内部可用标签介绍

本文详细介绍了HTML中有序列表和无序列表的使用方法,并通过具体示例展示了如何创建基本的列表,以及如何进行多级列表的嵌套。此外,还探讨了列表在不同场景下的应用。
1)有序列表标签<ol>
和列表标签相关的标签有两类,<ol>和<li>标签。<ol>和</ol>标签定义总的列表区域。<li>和</li>表示的是
在列表区域中的列表项。列表区域内可以包含多个列表项。浏览器在显示列表项时会自动为每个列表项添加序号。
具体的例子和示意图如下:
<!DOCTYPE html>
<html>
<head>
<title>Test Lists</title>
</head>
<body>
<h1>中国古代著名诗人</h1>
<ol>
<li>李白</li>
<li>杜甫</li>
<li>王勃</li>
<li>李商隐</li>
</ol>
</body>
</html>
 
2)无序列表标签<ul>
无序列表标签和有序列表标签的唯一区别就是有序列表标签的每个列表项都是有编号的,而无序列表标签
则没有编号,编号位置显示的是圆点。其他的都是一样的。下面是例子和示意图。
<!DOCTYPE html> 
<html> 
 <head>
 <title>Unordered Lists</title> 
 </head>
 <body>
 <h1>Some random thoughts</h1> 
 <p>underneath are things i randomly thought</p> 
 <ul>
 <li>sleep</li>
 <li>do sports</li> 
 <li>watch TV</li> 
 <li>play computer games</li> 
 </ul>
 </body>
 </html>
 
3)标签嵌套
<ul>、<ol>和<li>内部都可以互相嵌套,这样就可以形成多级标签。下面是例子和示意图.
<!DOCTYPE html> 
<html>
 <head>
 <title>Nested lists</title>
 </head>
 <body>
 <ol>
 <li>Dad's interests
 <ul>
 <li>football</li>
 <li>knitting</li> 
 </ul>
 </li>
 <li>Mom's interests
 <ul>
 <li>hating football</li> 
 <li>skydiving</li>
 </ul>
 </li>
 </ol>
 <ul>
 <li>Favorite Boys' Names 
 <ol>
 <li>孟星魂</li>
 <li>郭靖</li>
 <li>狄云</li>
 </ol>
 </li>
 <li>Favorite Girls' Names 
 <ol>
 <li>木婉清</li>
 <li>小昭</li>
 <li>双儿</li>
 </ol>
 </li> 
 </ul>
 <ul>
 <ol>
 <li>孟星魂</li>
 <li>郭靖</li>
 <li>狄云</li>
 </ol>
 </ul>
 </body> 
</html>
 
 
参考文献:
<?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>Login</class> <widget class="QWidget" name="Login"> <property name="windowModality"> <enum>Qt::ApplicationModal</enum> </property> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>652</width> <height>385</height> </rect> </property> <property name="windowTitle"> <string>图书馆管理系统</string> </property> <widget class="QLabel" name="label"> <property name="geometry"> <rect> <x>20</x> <y>20</y> <width>111</width> <height>41</height> </rect> </property> <property name="text"> <string><html><head/><body><p><span style=" font-size:16pt;">用户登录</span></p></body></html></string> </property> <property name="textFormat"> <enum>Qt::AutoText</enum> </property> </widget> <widget class="QLabel" name="user"> <property name="geometry"> <rect> <x>150</x> <y>90</y> <width>60</width> <height>41</height> </rect> </property> <property name="text"> <string><html><head/><body><p><span style=" font-size:12pt;">用户名</span></p></body></html></string> </property> </widget> <widget class="QLabel" name="password"> <property name="geometry"> <rect> <x>160</x> <y>150</y> <width>60</width> <height>26</height> </rect> </property> <property name="text"> <string><html><head/><body><p><span style=" font-size:12pt;">密码</span></p></body></html></string> </property> </widget> <widget class="QLabel" name="identify"> <property name="geometry"> <rect> <x>140</x> <y>180</y> <width>91</width> <height>59</height> </rect> </property> <property name="text"> <string><html><head/><body><p><span style=" font-size:12pt;">身份类型</span></p></body></html></string> </property> </widget> <widget class="QLineEdit" name="userline"> <property name="geometry"> <rect> <x>290</x> <y>100</y> <width>191</width> <height>21</height> </rect> </property> </widget> <widget class="QLineEdit" name="pwline"> <property name="geometry"> <rect> <x>290</x> <y>150</y> <width>191</width> <height>21</height> </rect> </property> <property name="echoMode"> <enum>QLineEdit::Password</enum> </property> </widget> <widget class="QComboBox" name="idbox"> <property name="geometry"> <rect> <x>320</x> <y>200</y> <width>121</width> <height>22</height> </rect> </property> <item> <property name="text"> <string>读者</string> </property> </item> <item> <property name="text"> <string>图书管理员</string> </property> </item> <item> <property name="text"> <string>系统管理员</string> </property> </item> </widget> <widget class="QPushButton" name="loginbt"> <property name="geometry"> <rect> <x>250</x> <y>270</y> <width>93</width> <height>28</height> </rect> </property> <property name="text"> <string>登录</string> </property> </widget> <widget class="QPushButton" name="exitbt"> <property name="geometry"> <rect> <x>420</x> <y>270</y> <width>93</width> <height>28</height> </rect> </property> <property name="text"> <string>退出</string> </property> </widget> </widget> <resources/> <connections/> </ui>添加自适应大小
05-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值