CSS Styles API
css.set()
Sets the inline CSS style values for the matched DOM elements.
- Accepts either two string arguments with an optional boolean value (true or false) to apply the !important rule, a single object, or a single string in "kebab-case" format only (for other cases you can use "kebab-case", "camelCase", or "snake_case" formats).
Example:
$('body').css.set('background-color', 'red');
// Sets the inline CSS style 'background-color: red;' on the <body> element.
$('div ?').css.set('marginLeft', '10px', true);
// Sets the inline CSS style 'margin-left: 10px !important;' on all <div> elements.
$('body').css.set({backgroundColor: 'red', margin_left: '10px', 'border-radius': '10px'});
// Sets the inline CSS style 'background-color: red; margin-left: 10px; border-radius: 10px;' on the <body> element.
$('div ?').css.set('background-color: red; margin-left: 10px!important');
// Sets the inline CSS style 'background-color: red; margin-left: 10px !important;' on all <div> elements.