When you use a selector, changes made to that selector will be applied to the element's children elements too?

If you have, let’s say a div with divs inside, you only need to select the parent div or do you have to select every child div individually?

1 Like

It depends on the properties being applied. Some the children inherit the properties but for others they don’t. For example the color property is inherited so the children would have that color applied. But with border it does not apply to the children if the targeted element.

2 Likes

is there a way to apply css rules to all of the elements inside the selected element, lets say, to apply the same rule set to all of the divs inside another div?

1 Like

For properties that are NOT inherited, you can just give all of the elements a class or id and give that class or id the property you want it to have.

2 Likes

makes sense, thank you!

1 Like