transform: translate() #359
Replies: 2 comments 1 reply
-
Hm, it's possible that there are some issues with transform and clipping. If you can make a reproducible I can take a look at it. With that said, I wouldn't really recommend using transform for layouting. What you could do instead is add an absolutely positioned element directly inside your body. So your body is centered using margins, but the inner element is used for the offset with e,g, top/left properties. |
Beta Was this translation helpful? Give feedback.
-
to reproduce the situation:
|
Beta Was this translation helpful? Give feedback.
-
hello, I have a task to place a document with an offset from the center. For example, you need to make an element offset (relative to the center of the context, not the top left edge) +200dp on the left and +90dp on the top, and you need to take into account that when the context is resized, these offsets are preserved. I do not know how to do it correctly, I found information that this can be done using margin: auto auto; and transform:translate(200dp, 25dp), and it would seem that this is my ideal solution, but .. inside the window I have a list, at first everything is fine, but when I started adding data to the list and when the list overflowed, a scroll appeared on the verticals when the appearance of the scroll - all the data of my list is gone. Randomly, I found that if the list has the attribute overflow:hidden auto; - then when a scroll appears - my data is shifted to their positions without taking into account transform:translate (while the window itself remains in its place with an offsettransform:translate), if you remove the overflow attribute - everything works fine, but then the overflow is not hidden and the scroll does not appear . How to be in this situation? Maybe there are other options for positioning documents relative to the center and not the top left edge? Is it a bug problem with transform:translate and overflow?
Beta Was this translation helpful? Give feedback.
All reactions