Applying more CSS properties within one line?

Note the different styles of defining the CSS rules: camelCase for javascript, "css-style" for quoted strings.

. Css({ color: "#16428b", backgroundColor: "#f0f", "font-size" : "3em" }) note the different styles of defining the CSS rules: camelCase for javascript, "css-style" for quoted strings. This is also much more efficient than multiple chains of successive .css() calls, since it doesn't require multiple passes through your jQuery object.

You just chain them: $('#') . Css("color", "#16428b") . Css("font-family", "Helvetica, Arial, sans-serif") .

Css("background", "#ccc"); Most methods in the jQuery object returns the jQuery object itself, so you just apply another method to the return value. Edit: If it's efficiency you are looking for it's of course best to update the element style directly: var e = document. GetElementById(''); e.style.

Color = '#16428b'; e.style. FontFamily = 'Helvetica, Arial, sans-serif'; e.style. BackgroundColor = '#ccc.

Chain it. $('#'). Css("color", "#16428b").

Css("background","black"); Most Jquery functions return the Jquery object so you can do more stuff. Alternatively, in the case of css, you can pass them in one properties object: $('#'). Css({color: "#16428b", background: "black"}); More info can be found here docs.jquery.com/CSS.

$('#'). Css("color", "#16428b"). Css("background", "1px solid red"); Will this do the trick?

Jquery's css selector can take a dictionary of options. So you could do this: $('#'). Css({ "color": "#16428b", fontWeight: "bold", "float": "left", "font-size": 2em }); Note that if you are not going to quote the property you need to camelCase it.

If you do quote it, using the hyphenated version is fine.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions