Tag Archives: jquery css method not working

jQuery css Method


jQuery css Method : is used to add the css styles to the selected elements.


Syntax 1

$(selector).css(propertyName);

propertyName(String): Css Style to be added.

jQuery css() Method Example 1


Try it »

Syntax 2 for jQuery css Method

$(selector).css(propertyNames);

propertyNames (Array): List of styles in form of array.
Example : {‘background’:’yellow’,’font-size’:’24px’,’border’:’2px solid red’}

jQuery css() Method Example 2


Try it »