.css()

Gets the computed value of a CSS property or sets one or more CSS properties on matched elements.

Syntax

jquery
$(selector).css(property)
$(selector).css(property, value)
$(selector).css({ prop: val, ... })

Example

jquery
// Get value:
var color = $(".box").css("color");

// Set single:
$(".box").css("background-color", "#6C5CE7");

// Set multiple:
$(".card").css({
  "border-radius": "8px",
  "box-shadow": "0 4px 20px rgba(0,0,0,0.3)"
});