【发布时间】:2018-05-07 05:37:34
【问题描述】:
我有一个简单的用例:项目标题和描述。标题应该出现在描述上方,我希望标题确定整列的宽度,“描述”行也是如此。
CSS Grid 是否可以实现,如果可以,如何实现?
这是所需的输出:
这就是代码,基本上:
.grid-container {
display: grid;
grid-template-columns: 1fr;
}
<div class="grid-container">
<div class="A">
DIV A contains the TITLE
</div>
<div class="B">
DIV B has much more text but I want its text to wrap to the width of div.A (no cut of words, just wrapping)
</div>
</div>
【问题讨论】: