0
このテーブルセル内のテキストを水平に整列するにはどうすればよいですか?それは右に浮いているように見えますが、私はなぜそれがわかりません。 https://jsfiddle.net/o06e11o9/テーブル内のテーブルセルを水平に整列する
HTML
<div class="affil2">
<div class="oval2"></div>
<div class="contents">
a lorem ipsum dolor sit amet. Donec facilisis tortor ut augue lacinia, at viverra est semper. Sed sapien metus, tempor a tortor.
<br />
<br /> Pellentesque non dignissim neque. Ut porta viverra est, ut dignissim elit elementum ut.
</div>
</div>
CSS
.affil2 {
align-content: center;
display: table;
text-align: center;
z-index: 20;
border: 1px solid #705A1D;
position: relative;
height: 200px;
width: 960px;
background-color: #af9254;
box-shadow: 0px 3px 10px 0px rgba(0, 0, 0, .35);
}
.contents {
margin: 0 auto;
text-align: left;
width: 600px;
display: table-cell;
vertical-align: middle;
color: #fff;
font-size: 18px;
}
.oval2 {
z-index: 1;
position: absolute;
top: -110px;
width: 1200px;
height: 250px;
border-radius: 100%;
background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.3) 0%, rgba(255, 0, 0, 0) 100%);
}
の私は、ソリューションの束をしようとしていた "奇妙なもの" のうちのいくつかの結果である可能性がありますが、ただ、ほとんどI私が何をしているのか分からない。 – HFHaunter
私は段落の形で私のテキストを保ちたい、それはなぜ私は600pxの幅でそれを持っていた。これを行うには、コンテンツ内に子divを作成する必要がありますか?その中にテキストを配置しますか? – HFHaunter
ああ。左右に均等にパディングすることで固定しました。お手伝いありがとう! – HFHaunter