You can go around that issue by setting a relative position to 50%, then translating the content 50% (which in that case will be 50% of the size of the element and not the parent):
Aah ofcourse, you are right. That is another solution for the same problem. Thanks for it.
I did found one downside though. This method feels to me to make it more difficult to have it scale better for responsiveness in cases where the child elements are less than 100vw and more than the --gap. But it is a personal preference I think.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You can go around that issue by setting a relative position to 50%, then translating the content 50% (which in that case will be 50% of the size of the element and not the parent):
Here is an example: codepen.io/alvaromontoro/pen/mdWgKdx
Aah ofcourse, you are right. That is another solution for the same problem. Thanks for it.
I did found one downside though. This method feels to me to make it more difficult to have it scale better for responsiveness in cases where the child elements are less than
100vw
and more than the--gap
. But it is a personal preference I think.