KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Is there any syntactical way in jQuery to define multiple CSS attributes without stringing everything out to the right like this: $("#message").css("width", "550px").css("height", "300px").css("font-size", "8pt"); If you have, say, 20 of these your code will become hard to read, any solutions? From jQuery API, for example, jQuery understands and returns the correct value for both .css({ "background-color": "#ffe", "border-left": "5px solid #ccc" }) and .css({backgroundColor: "#ffe", borderLeft: "5px solid #ccc" }). Notice that with the DOM notation, quotation marks around the property names are optional , but with CSS notation they're required due to the hyphen in the name.
Tags (comma-separated)
Save Edits
Cancel