1、代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>18-jQuery操作样式方法</title>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(function(){
$("div").css("width","100px");
$("div").css("height","100px");
$("div").css("background","red");
$("div").css("width","100px").css("height","100px").css("background","blue");
$("div").css({
width:"100px",
height:"100px",
background:"red"
})
console.log($("div").css("background"));
})
</script>
</head>
<body>
<div></div>
</body>
</html>
2、显示页面
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/1388b3a02529a7af7e2b0c583891d2df.png)