May 07, 2021 jQuery
The css() method sets or returns one or more style properties of the selected element.
To return the value of the specified CSS property, use the following syntax:
The following example returns the background-color value of the first matching element:
To set the specified CSS property, use the following syntax:
The following example sets the background-color value for all matching elements:
To set more than one CSS property, use the following syntax:
The following example sets background-color and font-size for all matching elements:
If you need the full contents of the jQuery CSS method, please visit our jQuery Reference Manual - CSS Operations!