2 回答

TA貢獻1869條經驗 獲得超4個贊
不要交替翻譯,先把所有英語放在最后,然后再放在所有非英語。然后,您可以依靠 CSS 網格而不是 Flexbox 來創建布局:
.container {
display:grid;
width:300px;
grid-auto-columns:1fr;
grid-auto-flow:dense;
}
.container > * {
grid-column:1;
}
.container > .tr {
grid-column:2;
}
<div class="container">
<p>Large en paragraph with 3 lines (English)</p>
<p>Both are aligned Like this. (English)</p>
<p class="tr">Shorter translation with 2 lines (Translation)</p>
<p class="tr">At the top of the paragraph (Translation)</p>
</div>

TA貢獻1833條經驗 獲得超4個贊
首先嘗試按列拆分文本,然后按每列中的段落拆分文本。垂直對齊可以通過“min-height”來完成。財產。
body {
display: flex;
}
div {
flex-grow: 1;
flex-basis: 50%
}
p {
min-height: 80px;
}
<body>
<div>
<p>Large en paragraph with 3 lines jhgvs dfhbs idufb sudhbh bdsfuyvbs odufyo iuyb (English)</p>
<p>Both are aligned Like this. (English)</p>
</div>
<div>
<p>Shorter translation with 2 lines (Translation)</p>
<p>At the top of the paragraph (Translation)</p>
</div>
</body>
- 2 回答
- 0 關注
- 155 瀏覽
添加回答
舉報