how can i align text content inside div horizonally-centered and vertically-centered?
<div style="height: 300px;">
<p>Envision various details for your big day with help from our photo catalog, which features images filtered by category. See actual works from suppliers to help you make decisions.</p>
</div>
You need to use display: table-cell;
and vertical-align: middle;
properties with text-align: center;
as well to align the text vertically and horizontally centered
div {
border: 1px solid #f00;
display: table-cell;
text-align: center;
vertical-align: middle
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.