gpt4 book ai didi

html - 如何将 Logo 添加到 css 中的以下 span 标记

转载 作者:太空宇宙 更新时间:2023-11-04 08:24:26 24 4
gpt4 key购买 nike

需要在下面的span标签中添加一些logo图片

<div class="container">
<div class="col-md-4">

<p><span class="glyphicon glyphicon-home"><br></span><b>LARGEST WAREHOUSES</b></p>
<h6>Transport provide best theme for lioeiusmod tempor dolor list</h6>

<p><span class="glyphicon glyphicon-pushpin"><br></span><b>GOOD TRACKING SUPPORTS</b></p>
<h6>Transport provide best theme for lioeiusmod tempor dolor list</h6>
</div>
</div>

我需要在这个 Bootstrap 默认字体图像附近添加 Logo

<span class="glyphicon glyphicon-home">
<span class="glyphicon glyphicon-pushpin">

我需要外部 css 文件我也有图像文件夹

最佳答案

您可以使用伪元素 ::before::after

.logo {
position: relative;
display: inline-block;
height: 20px;
width: 20px;
}

.logo::after {
content: "";
height: 100%;
width: 100%;
position: absolute;
top: 0;
bottom: 0;
left: 0%;
margin: auto;
background-image: url('http://imagespng.com/Data/DownloadLogo/Success-Transparent.png');
background-position: center;
background-size: contain;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>

<div class="container">
<div class="col-md-4">
<p><span class="logo"><br></span><b>LARGEST WAREHOUSES</b></p>
<h6>Transport provide best theme for lioeiusmod tempor dolor list</h6>

<p><span class="logo"><br></span><b>GOOD TRACKING SUPPORTS</b></p>
<h6>Transport provide best theme for lioeiusmod tempor dolor list</h6>
</div>
</div>

相应的风格

Fiddle

关于html - 如何将 Logo 添加到 css 中的以下 span 标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45272517/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com