Quantcast
Channel: CSS center content inside div - Stack Overflow
Viewing all articles
Browse latest Browse all 10

Answer by Mahendra Liya for CSS center content inside div

$
0
0

Try using flexbox. As an example, the following code shows the CSS for the container div inside which the contents needs to be centered aligned:

Depending on the axis of the flexbox, you will need to align or justify items, read more at MDN

.absolute-center {    display: -ms-flexbox;    display: -webkit-flex;    display: flex;    -ms-flex-align: center;    -webkit-align-items: center;    -webkit-box-align: center;    align-items: center;    justify-content: center;}

Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles



Latest Images