To center the inner div element we will make the parent a flex container. This short post we will take a look at how to center items not only horizontally but also vertically.įirst we will start simple with wanting to center a single item in a parent container. flex-start The flex items were aligned vertically at the top of the container. align-items: flex-start flex-end center baseline stretch This property accepts the following values. But here, the items were aligned across the cross access (vertically). CSS Flexbox is a layout model that helps align one directional items. The align-items property is same as justify content. There are many ways to center things in CSS but one of the easiest ways is to use CSS Flexbox.
0 Comments
Leave a Reply. |