Is it possible to tell the code to position by the center point of an element, rather than by the top-left point? If my parent element has
width
Here's one way to center a text element in the middle of the container (using a header as an example
CSS:
.header { text-align: center; top: 50%; left: 50%; transform: translate(-50%, -50%); position: absolute; }
It centers by a middle anchor point.