<div>
<p>
中央寄せテキスト<BR>2行目突入
</p>
</div>
div {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 150px;
background-color: skyblue;
text-align: center; /* 2行目以降のテキストも中央寄せ */
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.