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

<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
I just want to know if there’s a way to select and modify multiples CSS properties using the function .css()

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>

```

Replace this line with your code.

<do not remove the three backticks above>

you can simply select different elements:

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

you can use even use class and id selectors

1 Like

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)

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

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

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