xxxxxxxxxx
$('#element').css({'display': 'block', 'background-color' : '#2ECC40'});
xxxxxxxxxx
$("selector").css("property", "value");
// Example:
$("div").css("background-color", "red");
xxxxxxxxxx
//Set one style attribute
$('#element').css('display', 'block');
//Set multiple style attributes
$('#element').css({'display': 'block', 'background-color' : '#2ECC40'}); /* Multiple style *
xxxxxxxxxx
$(init);
function init() {
$("h1").css("backgroundColor", "yellow");
$("#myParagraph").css({ "backgroundColor": "black", "color": "white" });
$(".bordered").css("border", "1px solid black");
}
xxxxxxxxxx
$('button').css("background-color", "blue").css('color', 'white').css('border', '2px solid black');