Why do the X lines fix when I enable the 65th line in CSS?
Can someone explain it to me why are they getting centered when I apply for position absolute?
https://codepen.io/harunjonuzi/pen/NWOzwvQ?editors=1100
8 Replies
On your pseudo class for the "x" you need to uncomment the absolute position and center the lines.
This should work:
My question is why is this happening, I know that position absolute fixes it...
I just want to understand why does that seems to work
opps, sorry
😄
if you don't use absolute position the 2 lines will be placed in their normal position, one next to the other. If you comment out your rotations you will see this and will notice that neither of them are centered. So, when you rotate them they are being rotated around their relative center point and not the center of the cell.
To further demonstrate this, if you only had a single line it would be centered as you expect as there is no other element pushing it away from the center.
this is exactly the kind of explanation I was looking for, thank you very much
sorry I miss-understood your original question - your question is clear, I just skimmed it badly.
it's okay, have a wonderful day sir 😄