8. Changing Your Style - Is there a way to target multiple properties with the .css() function?


#1


I just want to know if there's a way to select and modify multiples CSS properties using the function .css()


Replace this line with your code.


#2

you can simply select different elements:

$('div').css()
$('p').css()

you can use even use class and id selectors


#3

Sorry I got it wrong, I meant to say properties.

What I mean is if there's a way to do this: $("div").css("background-color", "black", "border-radius", "10px", "height", "200px", etc etc)


#4

sure, but then the property values should be supplied as object:

.css({
      "background-color": "yellow",
      "font-weight": "bolder"
    });

#9

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.