css flex center horizontally and vertically

CSS
display: flex;
align-items: center;
justify-content: center;
Source

Also in CSS: