.css()
method
Gets or sets CSS properties on selected elements.
Syntax
$(selector).css(property) $(selector).css({property: value})
Example
javascript
// Get CSS value
const color = $('h1').css('color');
// Set single property
$('.box').css('background-color', '#3498db');
// Set multiple properties (object)
$('.box').css({
'background-color': '#3498db',
'color': 'white',
'padding': '20px',
'border-radius': '8px'
});