Was ist der beste/richtige Weg, um den Text vertikal in der Mitte der Spalte auszurichten? Die Bildhöhe wird im CSS statisch festgelegt.Bootstrap, wie Text in einem Div-Container vertikal auszurichten
Ich habe versucht, eine äußere div zu display: table
und eine innere div zu display: table-cell
mit vertical-align: middle
, aber das hat auch nicht funktioniert.
HTML
<section id="browse" class="browse">
<div class="container">
<div class="row">
<div class="col-md-5 col-sm-5">
<h2 class="text-left">Link up with other gamers all over the world who share the same tastes in games.</h2>
</div>
<div class="col-md-1"></div>
<div class="col-md-6 col-sm-7 animation_container">
<img id="animation_img2" class="animation_img animation_img2" src="images/section2img2.png"/>
<img id="animation_img1" class="animation_img animation_img1" src="images/section2img1.png"/>
</div>
</div>
</div>
</section>
CSS
.browse .container, .blind_dating .container { padding-bottom: 0; }
.animation_container { position: relative; }
.browse .animation_container { height: 430px; }
.animation_img { position: absolute; bottom: 0; }
.animation_img1 { right: 25%; }
.animation_img2 { right: 25%; }
Vielen Dank! Gut, den 'line-height
@TheNomad - Jederzeit! Ja, es ist ein sehr guter Trick, den man bei der vertikalen Ausrichtung beachten sollte. – Fizzix