Linux Systems Engineer
- Oct 18, 2019
- Reaction score
Centering elements vertically with CSS often gives trouble. However, there are several ways of vertical centering, and each is easy to use.
Use the CSS vertical-align property
The vertical-align property is used to vertically center inline elements.
The values of the vertical-align property align the element relative to its parent element:
- Line-relative values vertically align an element relative to the entire line.
- Values for table cells are relative to the table-height-algorithm, which commonly refers to the height of the row.
<center> <h2>www.vevioz.com</h2> </center>
<p align="center">Learn web programming at www.vevioz.com</p>
<p style="text-align:center"> Learn web programming at www.vevioz.com </p>