M
M
maxgeor2017-10-04 09:34:29
css
maxgeor, 2017-10-04 09:34:29

How to fix the child div_3, or rather -img in div_3, when rotating - the parent div_1?

Good afternoon!
How to fix child div_3, or rather img in div_3 when rotating - parent div_1?
Structure:

<div_1>
        <div_2>
                 <div_3><img></div_3>
        </div_2>
</div_1>

div_1 {
  -webkit-animation: spin 0.8s infinite linear;
}
@-webkit-keyframes spin {
  0% {
    -webkit-transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(360deg);
  }
}

!!! .div_3{
position: absolute;
}

Note: Rotates exactly - div_1!
Note_2: If - possible without JS! But.....
Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel Antonov, 2017-10-04
@maxgeor

no way, change the layout structure and make the elements visually as it should, but without nesting

G
Grigory S., 2017-10-04
@Grigory90

Rotate div_3 in the opposite direction, as an option.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question