+ 2
Align a text vertically to the center? HTML
How can I align a text vertically to the center?
6 ответов
+ 7
"vertical-align:middle;" works only with <td> ( and "display:table-cell;" styled element, if in a valid <table> structure )...
Old workaround for vertical text centering on a unique line, is to set the line height of the container with its height...
Modern way to vertical align is to use the FlexBox model:
https://code.sololearn.com/W8RqtEN6Tv8q/?ref=app
Accessory, @Agung Ramadhan Putra is twice bad: "align=center" is an html attribute deprecated in Html5, in addition to horizontal centering and not vertical :P
+ 6
vertical-align: middle;
or
position: absolute;
transform: translate(0, -50%);
top: 50%;
I prefer using the last one.
+ 1
thank you so much
0
adam can you help me
0
if I can then I'll try
- 2
align = center