jquery add style
snippet in javascript

jquery css

user8028

$('#element').css('display', 'block'); /* Single style */
$('#element').css({'display': 'block', 'background-color' : '#2ECC40'}); /* Multiple style */ 

jquery add style

user7156

//revising Ankur's answer
//Syntax:
$(selector).css({property-name:property-value});

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

jquery element css

user5227

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

change css jquery

user7266


$("p").css("background-color", "yellow");
 

jquery set width

user3556

$(".example").width("px");

edit css jquery

user7575

$('.ama').css('color','red');