<script src="jquery-1.11.1.js"></script>
<script>
$(function () {
//样式操作方法1(建值对的写法): css(json);
// $("div").css({"width":100,"height":100,"background-color":"pink"});
//样式操作方法2(链式编程): css(属性,值);
$("div").css("background-color","red").css("width",100px,");
//样式操作方法3:
$("div").css("background-color","red");
$("div").css("width",100px,");
})
</script>
</head>
<body>
<div></div>
<div style="width: 200px;height:300px;background: yellow"></div>
<div style="width: 200px;height:300px;background: yellow"></div>
<div style="width: 200px;height:300px;background: yellow"></div>
</body>
网友评论