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 关注
- 91 浏览
添加回答
举报