码迷,mamicode.com
首页 > Web开发 > 详细

html5中的选择器

时间:2014-11-13 14:36:56      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:style   color   div   html   htm   type   c   text   css   

1、html5中的属性选择器

<body>

<style type=text/css>

<!--1>完全匹配选择器-->

[id=test]{

  color:red;

  //比较严格只是匹配元素中的id是test的选择器

}

<!--2>包含匹配属性选择器-->

[id*=test]{

  color:green;

//相比较完全匹配的属性选择器这个的范围要广泛,只要是选择器的值中要test就可以被改变

}

<!--3>首部字符匹配属性选择器-->

[id^=test]{

  color:blue;

//只要是选择其中的头部是test的话,就会受到影响

}

<!--尾部字符属性选择器-->

[id$=test]{

  color:yellow;

}

//只要是属性选择器的尾部是test就会受到影响

</style>

<div id="test">Hello</div>

<div id="mytest">World</div>

<div id="tests>Thinks</div>

</body>

html5中的选择器

标签:style   color   div   html   htm   type   c   text   css   

原文地址:http://www.cnblogs.com/limit1/p/4094781.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!