Seek flexible layout and writing method

1:
<div style="width:100%;height:500px">
    
</div>

2:
<div style="width:200px;height:100px;position:absolute;top:50%;left:50%;margin-top:-100px;margin-left:-100px">

</div>

solve: Center the text horizontally and vertically (to ensure normal line wrapping, so you can"t use line-height)

Feb.28,2021

horizontal center: text-align: center;

Vertical center:

div {
    display: table-cell;
    vertical-align: middle;
}

here has a set of centered methods and demo.


reference case

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-1b37a99-410f1.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-1b37a99-410f1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?