css - Flex/Nowrap 不能在引导程序中使用第一列和文本截断
问题描述
我似乎无法让第一列不换行,CDT 继续进入第二行。第二列上有一个文本截断。我怎样才能让第一列展开,以便该列永远不会换行。
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.css" rel="stylesheet"/>
<div class="card-header text-center d-flex justify-content-center" style="width:350px">
<div class="mr-1 flex-nowrap" data-bind="html: TimeFormatted">
9:05 AM CDT
</div>
<div class="d-flex text-truncate">
@
<span class="text-truncate mx-1" data-bind="text: VenueName">
ACA dsf asdf sdsadf d fsd fsd fsd fsa
</span>
(<span data-bind="text: CourtName">East</span>)
</div>
</div>
解决方案
利用flex-shrink: 0
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.css" rel="stylesheet"/>
<div class="card-header text-center d-flex justify-content-center" style="width:350px">
<div class="mr-1 flex-shrink-0 flex-nowrap" data-bind="html: TimeFormatted">9:05 AM CDT</div><div class="d-flex text-truncate">@<span class="text-truncate mx-1" data-bind="text: VenueName">ACA dsf asdf sdsadf d fsd fsd fsd fsa</span> (<span data-bind="text: CourtName">East</span>)</div>
</div>
推荐阅读
- ios - 为什么我的自定义 CSS 文件类型不显示供 iOS 模拟器上的 FilePick 选择?
- python - Python中的列排列
- javascript - document.documentElement.clientWidth 与 window.innerWidth 性能
- html - 如何使图像适合不同的屏幕分辨率?
- php - 使用 eloquent 向刀片显示 laravel 数据时出错
- editor - 如何在内置 MobaXterm 编辑器中注释或取消注释多行?
- json - JSON 的大小
- facebook - Facebook 目录 - 无法使每个页面的多个产品变体与 JSON-LD 一起使用
- python - 为什么我的积分的绝对误差估计大于积分(使用 scipy.integrate.nquad)?
- postgresql - PostgreSQL:将 UUID 转换为 OID