I want to get the styles that the class has .class-one
and have them added to the class .class-inheritance
. Is there a way to do it?
.class-one {
color: black;
}
.class-inheritance {
background-color: red;
}
I want to get the styles that the class has .class-one
and have them added to the class .class-inheritance
. Is there a way to do it?
.class-one {
color: black;
}
.class-inheritance {
background-color: red;
}
in the class in html you can put more than one class, and taking advantage of that you put the classes you want without needing to inherit anything, and you can have the style of a base class and add more
You could use the fact that both classes start with
class
. You can create rules that apply to all classes that start withclass
:What you can do is join both classes in the same set of style rules, that is to say like this:
.class1, .class2
Below is an example.