Translate will more the element relative to its original position, which in this case is below the <p> element, so you have had to rely on magic numbers to push it to the top on the <p>, which as is usually the case with magic numbers is a tragically fragile approach, because the height of the <p> can vary with differing screen widths and font sizes or edits to the content.
I used the absolute positioning to place it relative to the top of its parent container, which is probably best given the html structure where the element appears after the element it goes at the top of.
You did give the element the property of position: absolute but you did not then position it using any of the “side” keywords (top, bottom, left, right), you used translate to position it instead.