My pleasure 😄😄, I think you meant using .slider__next{ top: calc(50% - 15px/2); }.
It will work here because you know the height of the element already; so you can simply subtract half of its hight from the top position.
But in other scenarios, the height of the element will be unknown for example a text paragraph, in most cases, you can't know exactly its height.(suppose it positioned absolute) the transform technique will be better here.
text paragraph example
There are cases, where the height of the element will change in mobile (using a media query), so you have to change it again by subtracting the new height.
There are many ways to center elements (flex-box, grid,... ), so use the way that suits your situation best.
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.
My pleasure 😄😄, I think you meant using .slider__next { top: calc(50% - 15px/2); }.
It will work here because you know the height of the element already; so you can simply subtract half of its hight from the top position.
But in other scenarios, the height of the element will be unknown for example a text paragraph, in most cases, you can't know exactly its height.(suppose it positioned absolute) the transform technique will be better here.
There are cases, where the height of the element will change in mobile (using a media query), so you have to change it again by subtracting the new height.
There are many ways to center elements (flex-box, grid,... ), so use the way that suits your situation best.