我想使3個框相鄰的文本中。到目前爲止,我得到的框設置正確。但是當我添加文本時,它會跳躍式跳躍。當我在div中輸入相同數量的段落標記時,它們都對齊。但是當一個div有1段標籤,其他有2段時,它們不再對齊。 我不知道如何解決這個問題。內聯塊與段落不斷跳
的jsfiddle:https://jsfiddle.net/gegc8nuk/
.row {
max-width: 1140px;
margin: 0 auto;
}
section {
padding: 80px 0;
}
.wrap {
display: table;
/* Webkit Fix */
width: 100%;
/* set width to stop display table shrink to fit */
word-spacing: -1em;
/* hide whitespace nodes (not in webkit) - will never overlap even if zoomed */
}
.tox {
display: inline-block;
height: 200px;
width: 100%;
word-spacing: 0;
color: #fff;
padding: 5%;
/* reset parent */
}
.red {
background-color: #9a0000;
}
.green {
background-color: #4ce215;
}
.blue {
background-color: #240fc3;
}
<section>
<div class="row">
<div class="wrap">
<div class="tox red span-1-of-3">
<p>Hello</p>
</div>
<div class="tox green span-1-of-3">
<p>Hello</p>
</div>
<div class="tox blue span-1-of-3">
<p>Hello</p>
<p>Hello</p>
<p>Hello</p>
</div>
</div>
</div>
</section>
什麼是你期望的輸出? *「上下跳動」的含義是什麼? – ketan
垂直對齊內嵌塊元素並排使用...'vertical-align:top;' –