Centre align any element, using CSS
Published in
1 min readJun 28, 2018
Making HTML elements centralised is sometimes a panic task, but is to be done frequently. Here are some small tips to keep element in centre of another element.
Simple yet depreciated way:
<center> … </center>
Best Alternative:
.parent {
display: flex;
justify-content: center;
align-items: center;
}