有关before after

Posted on 2015-04-08 15:26  小蕊同学  阅读(79)  评论(0编辑  收藏  举报
 1 <!doctype html>
 2 <html>
 3 <head>
 4 <meta charset="utf-8">
 5 <title>无标题文档</title>
 6 <style>
 7 h1{
 8  counter-increment:it;              /*定义一个名字,在h1前面添加*/
 9 }
10 h1:before{
11  content:counter(it)"、";
12  }
13 h1:after{
14  content:'-end';
15  }
16 a:after{
17  content:attr(href);  /*把前面的链接拿出来*/
18 }
19 a:before{
20  content:url(images/arrow.png);}
21 </style>
22 </head>
23 <body>
24 <h1>张三</h1>
25 <h1>李四</h1>
26 <a href="http://www.baidu.com">百度网</a>
27 </body>
28 </html>

a:befor{

content:'-end';

}

Copyright © 2024 小蕊同学
Powered by .NET 9.0 on Kubernetes