html - 停止在字体真棒图标周围环绕文本
问题描述
嗨实际上我试图阻止环绕字体真棒图标的文本。我尝试了很多方法。但这些在这种情况下不起作用。请帮我解决这个问题。
body {
font-family: "Montserrat";
}
.fa {
margin-right: 10px;
font-size: 20px !important;
}
<link href="https://cdn.paperindex.com/bootstrap/css/font-awesome.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Lato|Montserrat" rel="stylesheet" type="text/css">
<div class="dashboard-profile-wrp dashboard-todo">
<p><i class="fa fa-rocket mob-mnu-icon" aria-hidden="true" data-original-title="" title=""></i><a href="/dashboard/boost-your-sales.html" class="link" data-original-title="" title="">Upgrade Membership</a> to <b>connect with buyers like never before</b> and grow your sales beyond your local and national boundaries.and grow your sales beyond your local and national</p>
<p><i class="fa fa-shopping-basket fa-fw" aria-hidden="true"></i><a href="/dashboard/boost-your-sales.html" class="link" data-original-title="" title="">Upgrade Membership</a> to <b>connect with buyers like never before</b> and grow your sales beyond your
local and national boundaries.and grow your salesgrow your sales </p>
<p><i class="fa fa-camera fa-fw" aria-hidden="true"></i><a href="/dashboard/boost-your-sales.html" class="link" data-original-title="" title="">Upgrade Membership</a> to <b>connect with buyers like never before</b> and grow your sales beyond your local
and national boundaries.and grow your sales beyond your local and national boundaries.</p>
</div>
解决方案
给段落左填充,并使用左移图标text-indent
:
body {
font-family: "Montserrat";
}
p {
padding-left: 1.5em;
}
.fa {
text-indent: -1.3em;
font-size: 20px !important;
}
<link href="https://cdn.paperindex.com/bootstrap/css/font-awesome.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Lato|Montserrat" rel="stylesheet" type="text/css">
<div class="dashboard-profile-wrp dashboard-todo">
<p><i class="fa fa-rocket mob-mnu-icon" aria-hidden="true" data-original-title="" title=""></i><a href="/dashboard/boost-your-sales.html" class="link" data-original-title="" title="">Upgrade Membership</a> to <b>connect with buyers like never before</b> and grow your sales beyond your local and national boundaries.and grow your sales beyond your local and national</p>
<p><i class="fa fa-shopping-basket" aria-hidden="true"></i><a href="/dashboard/boost-your-sales.html" class="link" data-original-title="" title="">Upgrade Membership</a> to <b>connect with buyers like never before</b> and grow your sales beyond your
local and national boundaries.and grow your salesgrow your sales </p>
<p><i class="fa fa-camera" aria-hidden="true"></i><a href="/dashboard/boost-your-sales.html" class="link" data-original-title="" title="">Upgrade Membership</a> to <b>connect with buyers like never before</b> and grow your sales beyond your local
and national boundaries.and grow your sales beyond your local and national boundaries.</p>
</div>
推荐阅读
- json - 使用scala比较两个具有不同项目排列的Json
- android - 将 Spek 与挂起方法一起使用
- angular - Angular & Electron - 执行外部应用程序
- css - 如何禁用特定域列表中的整个 CSS 样式表?
- gitlab - 仅使用动态:更改 .gitlab-ci.yml 中的配置
- css - 如何使用 scss/sass 在关闭时为 MatDialog 设置动画?
- excel - 使用 VBA 方法通过 Bing API 获取距离
- c - 为什么在宏定义中对单个值使用括号?
- reactjs - 为什么我必须在这个反应输入表单中输入两次?
- html - 跨度将采用最大宽度大小,以防内容在多行上中断