I am just learning CSS and would like to ask for help. I can center the text vertically and horizontally but at the expense of the inline-block property. So my question is: how to center the text vertically and horizontally without losing the inline-block property in the .aboutme-trio__section element ?
https://codepen.io/WitekItDev/pen/bGKgemp
I am just starting out, please bear with me.
I have tried these methods:
https://www.w3.org/Style/Examples/007/center.en.html
The result? Everything comes crashing down.
To center the content inside your
.aboutme-introduction__section
element you can add the following:display: flex
make the element a flex container, which allows you to easily center the elements inside itflex-direction: column
tell the element to stack the elements vertically instead of placing then horizontally side-by-sidealign-items: center
centers the children items on the cross-axisjustify-content: center
center the children items on the main-axisThen you get:
Here is some good information about it on MDN: