jquery操作样式方法(三种方法)
程序员文章站
2022-05-18 19:13:22
...
jquery操作样式方法(三种方法)
方法1:
<script>
$(function(){
$("div").css("width","100px");
$("div").css("height","100px");
$("div").css("background","red");
</script>
方法2:
<script>
$("div").css("width","100px").css("height","100px").css("background","blue");
</script>
方法3:
<script>
$("div").css({
width:"100px",
height:"100px",
background:"green"
</script>