<body>
<style>
*{
/*color: ;*/
margin: 0;
padding: 0;
box-sizing: border-box;
}
</style>
<button class="btn">press</button>
<script src="./库/jquery-1.9.1.js"></script>
<script>
//jQuery操作css样式时可以链式操作
$(".btn").css("width","100px").css("height","100px")//单属性操作
//多属性写法
$(".btn").css({
width:"200px",
height:"150px",
backgroundColor:"#3da6b1",
color:"#de3131",
borderRadius:"15px"
})
//获取css
//只能单个获取,不能多个
console.log($(".btn").css("width"));
</script>
</body>
2021-02-24 jQuery css属性获取/操作
最新推荐文章于 2021-07-07 16:48:57 发布