The css() method sets or returns one or more style properties of the selected element.
Set CSS properties
To set specific CSS properties, please use the following syntax:
css("propertyname","value");
The following example will set the background-color value for all matching elements:
Example
$("p").css ("background-color","yellow");
Set multiple CSS properties
To set multiple CSS properties, please use the following syntax:
css({"propertyname":"value","propertyname":"value ",...});
The following example will set the background-color and font-size for all matching elements:
Example
$("p").css({"background-color":"yellow","font-size ":"200%"});
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn