读属性:
$(selector).css(name)
设置属性:
法一:
$(selector).css(name,value)
法二:
$(selector).css(name,function(index,value))
$("div").click(function() {
$(this).css(
"width", function(index, value) {return parseFloat(value) * 1.2;}
);
});
法三:
$(selector).css({property:value, property:value, ...})
$("p").css({
"color":"white",
"background-color":"#98bf21",
"font-family":"Arial",
"font-size":"20px",
"padding":"5px"
});