我只想對齊兩個div彼此相鄰,並在每個垂直中間對齊內容。任何幫助可以挽救我的心理健康。這裏是我的代碼:垂直對齊(內嵌,中間)與圖像和文字divs
.main-kozossegitag-container {
\t display: block;
\t width: 100%;
\t height: 100%;
}
.main-kozossegitag-text1 {
\t display: inline-block;
\t width: 60%;
\t height: 100%;
\t vertical-align: middle;
\t text-align: right;
}
.main-kozossegitag-nev {
\t font-size: 2em;
}
.main-kozossegitag-title {
\t font-size: 1em;
}
.main-kozossegitag-visszhang {
\t font-size: 1em;
}
.main-kozossegitag-image1 {
\t display: inline-block;
\t width: 39%;
}
.profilkep {
max-width: 100%;
\t height: auto;
\t border-radius: 50%;
\t border: 3px solid rgba(255,255,255,0.5);
\t box-shadow: 1px 1px 5px rgba(0,0,0,0.3);
}
<div class="main-kozossegitag-container">
<div class="main-kozossegitag-text1">
<h3 class="main-kozossegitag-nev">Rita</h3>
<p class="main-kozossegitag-title">CEO</p>
<p class="main-kozossegitag-visszhang">Lorem ipsum dolor sit amet.</p>
</div>
<div class="main-kozossegitag-image1">
<img src="http://www.kaptarcoworking.hu/wp-content/uploads/2015/07/szabo_rita.jpg" alt="Szabó Rita" class="profilkep">
</div>
</div>
正如你所看到的兩個div是彼此相鄰,但我不能在中間:(
非常感謝你,這真的很有幫助! –