码迷,mamicode.com
首页 > 其他好文 > 详细

jQ伪类选择器

时间:2017-03-10 10:52:46      阅读:291      评论:0      收藏:0      [点我收藏+]

标签:weight   htm   ack   asc   round   class   oct   type   set   

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">

</style>
</head>
<body>
<ul>
<li>1111</li>
<li>2222</li>
<li>3333</li>
<li>4444</li>
<li>5555</li>
<li class="li1">6666</li>
<li>7777</li>
<li>8888</li>
<li>9999</li>
<li>0000</li>
</ul>
<script src="js/jquery-1.11.3.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
$(‘ul li:first‘).css({‘color‘:‘red‘})
$(‘ul li:last‘).css({‘color‘:‘blue‘})
$(‘ul li:eq(3)‘).css({‘background‘:‘red‘})
$(‘ul li:even‘).css({‘border‘:‘1px solid yellow‘})
$(‘ul li:odd‘).css({‘border‘:‘1px solid pink‘});
$(‘ul li:gt(5)‘).css({‘font-size‘:‘25px‘})
$(‘ul li:lt(5)‘).css({‘font-weight‘:‘600‘})
$(‘ul li:not(.li1)‘).css({‘background‘:‘#abcdef‘})
</script>
</body>
</html>

jQ伪类选择器

标签:weight   htm   ack   asc   round   class   oct   type   set   

原文地址:http://www.cnblogs.com/zzgyq/p/6529285.html

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