Reputation: 1315
How can I apply a class properties to a class which has selectors in pure CSS? Example:
.one{color:red;}
.two{color:blue;}
.two:hover{ /*Apply class ".one" to class ".two" when the event is triggered */}
Upvotes: 0
Views: 35
Reputation: 1152
quite simple:
.two {
color: blue;
}
.one, .two:hover {
color: red;
}
Hope this helps! If you ever did port over to SASS you could do it a little cleaner like:
.one {
color: blue;
}
.two {
color: red;
&:hover {
@extend .one;
}
}
Upvotes: 2