关于html的几个总结

一,关于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等,只要自己实践一下,即可轻松掌握,做到举一反三。

希望能帮到你。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值