一,关于ul、ol的用法:
示例1:
<DOCTYPE html>
<html>
<head>
<style>
ol b{list-style-type:decimal;color:blue} ul i{list-style-type:square;color:cyan}
hr{
color:green;
background-colro:green;
height:3px
}
</style>
</head>
<body>
<hr>
<dl>
<dt>The Things Of Today</dt>
<ol>
<li>Act plans</li>
<li>Special plans:</li>
<ul>
<li>to study</li>
<li>to rest</li>
<li>to sleep</li>
</ul>
<li>TO summary!</li>
</ol>
</dl>
</hr>
</body>
</html>
示例二:
<DOCTYPE html>
<html>
<head>
<style>
<hr{
color:green;
background-color:green;
height:3px;
}
ul{
list-style-type:square
}
ul ul{
list-style-type:disc}
ul ul ul{list-style-type:circle}
</style>
</head>
<body style="background-color:teal;color:cyan">
<ul>
<li>to study</li>
<li>to watch movie</li>
<li>to sing songs</li>
<ul>
<li>to play basketball</li>
<li>to do homework</li>
<li>to read blogs</li>
<ul>
<li>go to fish</li>
</ul>
</ul>
</ul>
<hr>
I like code,and i believe the code will change the world!
</hr>
</body>
</html>
二、关于定义列表的用法
<DOCTYPE html>
<html>
<head>
<style>
.cyd {
color:teal
}
#wsq{
color:cyan
}
dt{
color:green;
margin:0 auto;
}
dd{
color:red;
margin:0 auto;
}
#wansuqi{
color:gray;
margin:0 auto;
}
</style>
</head>
<body>
<dl>
<dt>Important Things</dt>
<dd>I believe two roles:</dd>
<li class="cyd">Just do it!</li>
<li id="wsq">I like Sukey Wan!</li>
<dd id="wansuqi">Love the world,and you will have all!</dd>
</dl>
</body>
</html>
三、关于网页中鼠标盘旋与触碰、点击变色的用法
<DOCTYPE html>
<html>
<head>
<style>
a:link{color:blue}
a:visited{color:green}
a:hover{color:teal}
a:active{color:red}
</style>
</head>
<body>
<a href="cyd.html">第二种日记模板</a><br>
</body>
</html>
四、对于级联式样表的用法:
1、将定义的样式属性单独抽取出来,放在新建好的以后缀名为.css的文件,然后用记事本进行属性编辑
比如:
建立一个cyd.css的文件,内容如下:
a:link{color:blue}
a:visited{color:green}
a:hover{color:teal}
a:active{color:red}
然后再建立一个以后缀名为.html的文件,用记事本编辑的内容如下:
<DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="wsq.css">
</head>
<body>
<a href="cyd.html">I love Life</a><br>
</body>
</html>
对于cyd.html,自由编写一个html的文件即可。
总之,编写html的文件,主要是活用ol,ul,style,span,p,li,color等,只要自己实践一下,即可轻松掌握,做到举一反三。
希望能帮到你。