December 2013
Intermediate to advanced
384 pages
9h 54m
English
jQuery makes it extremely easy to get and set CSS values using the .css(property, [value]) method. For example, the following code retrieves the cursor CSS property value of an element:
$("#buttonA").css("cursor");
Then the following sets the border-radius value:
$("#buttonA").css("border-radius", "10px 15px");
The .css() method also allows you to pass a map object with properties and values. This allows you to set several settings at once. For example, the following code uses .css() to set the margin, padding, float, and font-weight attributes at the same time:
$("span").css({margin:0, padding:2, float:"left", ...
Read now
Unlock full access