How is the css text centered?

text wraps lines automatically, and neither text-algin nor
vertical-align works. Is there any way not to use display:table-cell,?
 .cell {
        float: left;
        width: 40px;
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: normal;
        word-break: break-all;
        line-height: 23px;
        padding-left: 10px;
        padding-right: 10px;
        height: 120px;
        text-align: center;
    }
<div class="cell"></div>
<div class="cell"></div>

clipboard.png

Css
May.22,2021

flex layout
display:flex;
align-items: center;


this is easier with flex layouts.

.xxx{
   display:flex;
   justify-content: center;
   align-items: center; 
}

line-height


Please check the code

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e5edc5-67185.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e5edc5-67185.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?