Back

.css( property, [value] )

Get or set the style of each element in the current set

If property is a String and value is NOT passed, this will return the current value for that style property on the first element in the set

If property is a String and value is provided, this will set the value for that style property on all elements in the set

If property is an Object, styles will be set for each key:value pair on all elements in the set

Params

property{String/Object}The String name of a css property, or an Object with key:value pairs
value{String} [optional]The value to be set. Numerical values should include units.

Returns

Current style value or DollarJS (chainable)

Examples

$('p').css('color')
$('p').css('color', '#336699')
$('p').css({ color: '#336699', fontSize: '14px' })