完全に中央に配置されているように、<p>
要素をコンテナの中央に配置する必要があり<div>
ます。上、下、左、右の余白でスペースが均等に分割されます。
どうすればそれを達成できますか?
div {
width: 300px;
height: 100px;
}
p {
position: absolute;
top: auto;
}
<div>
<p>I want this paragraph to be at the center, but it's not.</p>
</div>