在 <i> 元素周围环绕文本
Posted
技术标签:
【中文标题】在 <i> 元素周围环绕文本【英文标题】:Wrap text around <i> element 【发布时间】:2019-06-11 13:26:48 【问题描述】:我正在尝试将文本环绕在一个很棒的字体元素上,但我得到了以下内容
我希望文本从顶部开始并环绕元素。这可能吗?
这是我写的代码https://www.bootply.com/KtlIG2icyT
【问题讨论】:
你想要标题旁边的图标吗? 不,只是图标周围的文字。谢谢@UdhayTitus 【参考方案1】:这是我的工作: https://codepen.io/anon/pen/ZVNpQE
我可以通过将(见下文)添加到您的图标元素来修复它:
float: left
【讨论】:
【参考方案2】:使用这个<i class="far fa-file fa-9x text-info" style="float: left; margin-right:7px;"></i>
而不是你的<i class="far fa-file fa-9x text-info pull-left"></i>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.1/css/all.css">
<div class="card border-secondary my-3">
<div class="card-header">
<h3>Title</h3>
</div>
<div class="card-body text-secondary">
<div class="card-text">
<div class="row align-text-top">
<div class="col px-5 ">
<i class="far fa-file fa-9x text-info" style="float: left; margin-right:7px;"></i>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
<div class="col">
<asp:fileupload id="fuDocument" runat="server" cssclass="btn btn-secondary" allowmultiple="False" >
<p class="mt-2">
<asp:button id="btnUploadFile" runat="server" text="Υποβολή" cssclass="btn btn-primary" onclick="btnUploadFile_Click">
</asp:button></p>
</asp:fileupload></div>
</div>
</div>
</div>
</div>
</div>
<div id="push"></div>
【讨论】:
太棒了! Ty Udhay 和@Tom Dickson 你的建议成功了! :)以上是关于在 <i> 元素周围环绕文本的主要内容,如果未能解决你的问题,请参考以下文章