How to use transform:translateX to move a child element horizontally 100% across the parent
问题 All, I'd like to be able to use translateX to animate a child element 100% of the way across it's parent (i.e., from the left edge to the right edge). The challenge is that percentages in translateX refer to the element itself, not the parent. So, for example, if my html looks like this: <div id="parent"> <div id="child"> </div> And my CSS like this (vendor-prefixes omitted): #parent { position: relative; width: 300px; height: 100px; background-color: black; } #child { position: absolute;