I want to position a (or a
) element at the center of the screen irrespective of screen size. In other words, the space le
-
2020-11-28 19:12
I would do this in CSS:
div.centered {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
then in HTML: