jQuery操作CSS也是很方便的,咱先看看这几个常用的方法:
<style type="text/css">
.red{
color : red;
}
.paragraph{
font-weight: bold;
font-size: xx-large;
}
</style>
一些内容
另一个文本
{{--js--}}
<style type="text/css">
.red{
color : red;
}
.paragraph{
font-weight: bold;
font-size: xx-large;
}
</style>
一些内容
另一个文本
{{--js--}}
<style type="text/css">
.red{
color : red;
}
.paragraph{
font-weight: bold;
font-size: xx-large;
}
</style>
一些内容
另一个文本
{{--js--}}
返回一个css 我们只需要在css方法中写出要获取的css类型就好。
$(document).ready(function() {
$("#btn1").click(function () {
alert($("#p1").css("background-color"));
});
});
我们可以设置一个或多个css样式:
手机扫一扫
移动阅读更方便
你可能感兴趣的文章