how to vertically center div in css code example Example: center elements vertically in div .container { display: flex; align-items: center; }