JQurry $() css() 用法

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>Document</title>


<script type="text/javascript" src='js/jquery-1.12.1.min.js'></script>
<style>
*{margin:0;padding:0}
</style>


</head>
<body>
<div id="wrap">
<ul>
<li>1</li>
<li>1</li>
<li>2</li>
<li>2</li>

</ul>
</div>
<p>11</p>

<script>
$('#wrap ul li,p').css({
color:'#f00',
fontSize:'20px'
});
</script>

<script>

//选择某一个li元素进行操作

 


$('li').eq(1).css('color','#f00');
</script>


</body>
</html>

posted @ 2016-07-01 14:37  Jessi_JIA  阅读(461)  评论(0编辑  收藏  举报