Theodore Steiner
Theodore Steiner

Reputation: 1615

Triggering Multiple CSS Events

I have a List Item that on hover, changes its BG color and also makes the border right grow out from 0-7px. Within the list item there is a label for a radio input that is toggling content off and on when clicked. When the border grows, the label gets pushed over.

Is it possible to specify that on hover attributes X and Y happen to the list item, while triggering another css event to change the z-index of the label?

Upvotes: 0

Views: 553

Answers (1)

theJoi
theJoi

Reputation: 403

In general, if you want to hover over one element and this trigger an action on an adjacent element, just use plus sign. For example,

.hoverable:hover + .actionable {

Check out this codepen for a simple working example: http://codepen.io/Joi/pen/VKZqAX

Upvotes: 2

Related Questions