Tutorial - How To Make Text In The Middle With HTML and CSS | Vevioz Community

Tutorial How To Make Text In The Middle With HTML and CSS

DevOps

Linux Systems Engineer
Joined
Oct 18, 2019
Messages
136
Reaction score
11
Points
18
Location
Indonesia
Website
www.anymusics.com
Offline
Annotation 2020-09-05 181625.png

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.
Example of vertically aligning a text:
Code:
<center> <h2>www.vevioz.com</h2> </center>
Code:
<p align="center">Learn web programming at www.vevioz.com</p>
Code:
<p style="text-align:center"> Learn web programming at www.vevioz.com </p>
 
Top Bottom