Snippet

JQuery Element CSS

3 réponses de la communauté

$('#element').css('display', 'block'); /* Single style */
$('#element').css({'display': 'block', 'background-color' : '#2ECC40'}); /* Multiple style */ 
//Set one style attribute
$('#element').css('display', 'block');
//Set multiple style attributes
$('#element').css({'display': 'block', 'background-color' : '#2ECC40'}); /* Multiple style *
Syntax:
$(selector).css(property-name:property-value);

Example:
$('.bodytext').css('color':'red');