jquery element css
snippet in javascript

jquery css

user2391

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

jquery element css

user3390

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

Jquery .css

user5283

$(init);
    
function init() {
    $("h1").css("backgroundColor", "yellow");
    $("#myParagraph").css({"backgroundColor":"black","color":"white");
    $(".bordered").css("border", "1px solid black");
}

styling element using jquery

user3259

Syntax:
$(selector).css(property-name:property-value);

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