�
�
â–ª â–ª2018-02-15 02:58:05
css
â–ª â–ª, 2018-02-15 02:58:05

Unnecessary inheritance?

The div has two blocks - left-block and right-block. When a block appears, there is an animation for two blocks. The problem is that in the right-block block there is another left-block block and for some reason it inherits the animation that occurs in a separate left-block block. Is it possible to make a left-block placed inside a right-block not inherit the animation that happens with a left-block not nested within a right-block?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Elwen, 2018-02-15
@Elwen

Give the blocks to be animated special classes or id's where the animation is assigned.
On the plus side: less inheritance, cleaner code, and the ability to reuse animation when needed.
Or set the animation with hard inheritance, for example:

.parent > .left-block{...}
.parent > .right-block{...}

This method is better to use if you have a unique animation for these blocks and it will not be used anywhere else.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question