0
相対>絶対>相対>テキスト内のテキストを中央に配置しようとしています。私は見つけることができるソリューションのほとんどを試しましたが、私はそれを水平に集中させることしかできません。ここに私がこれまで持っているもののFiddleがあります。相対的な>絶対>相対的なdiv内の中央のテキスト
HTML:
<div class='outer'>
<div class='inner'>
<div class='inner1'>
<p>
text
</p>
</div>
</div>
</div>
はCSS:
.outer{
position: relative;
width: 500px;
height: 250px;
background-color: red;
}
.inner{
position: absolute;
width: 100px;
height: 100px;
background-color: blue;
top:20px;
left: 50px;
}
.inner1{
position: relative;
}
.inner1 p{
text-align: center;
margin: 0;
}
ありがとうございます。それがxDの解です –