【问题标题】:I want in one line with bootstrap 4. But it doesn't work我想与 bootstrap 4 在一行中。但它不起作用
【发布时间】:2020-11-18 07:46:18
【问题描述】:
我的 Html 代码(使用 Bootstrap4)。
<div>
<span class="d-inline-block">
<i class="fa fa-file-alt fa-3x text-primary"></i>
</span>
<span class="d-inline-block">Kadastrinis numeris: <strong style="font-size: 22px;">8741/0002:0014</strong></span>
</div>
出来:
但需要内联,例如:
【问题讨论】:
标签:
html
css
bootstrap-4
frontend
【解决方案1】:
我添加了 div 类 d-inline-flex 这个工作
【解决方案2】:
是这样的吗?
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css" rel="stylesheet" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css" rel="stylesheet" />
<!-- code below this line -->
<div class="d-flex flex-wrap">
<span class="align-self-center p-2">
<i class="fa fa-file-alt fa-3x text-primary"></i>
</span>
<span class="align-self-center d-inline-flex p-2 flex-column">Kadastrinis numeris:
<strong style="font-size: 22px;">8741/0002:0014</strong>
</span>
</div>