0
How to prevent an element from changing its position like given in this code. Checkout code.
13 Réponses
+ 2
Just remove position:absolute; from line 56 and 57. It's enabling overlapping.
+ 2
Adil, there is still one issue!
Checkout first div and second div. First div is given absolute and the second is not.
Why the first div not overlapping over second div even though we are using absolute attribute in first div?
+ 2
No Problem 😊
Always happy to help 🤠
+ 1
Please use the tags "html" next time, it's much more meaninful.
+ 1
Adil, as much i understand position absolute doesn't enable overlapping instead it removes them from flow. That's why the last <div> didn't postition down from the second last <div>. And overlapping is like normal feature of elements but static positioning or normal flow prevents it from happening.
And thanks cause your comment was helpful in finding my solution. I replaced position with margin.
+ 1
Yup! You're right. That's what I meant.
Actually position absolute removes elements from their normal flow which results in overlapping.
That's my pleasure 🙌
It's nice that you've found the solution.
Happy Coding 🤠
+ 1
You've set position absolute in div1 animation not in div1 entirely. Try setting it after line 3.
+ 1
Finally i got it.
It was a complex code for me.
Giving absolute positioning in animation gave such a confusing result.
Thanks for your time
0
🤨what does that mean Chaverra McCallop?
0
Ok
0
Chad
0
It is better to use transform:translate( x, y) for such positioning
- 2
Hi
How arw dat