18910140161

HTML-如果浏览器不支持WebP格式,如何在CSS背景图像属性中指定备用图像-堆栈溢出

顺晟科技

2022-10-18 12:57:17

88

我有一个带有背景

图像的元素。
<代码><;DIV类=";COL-SM-6 COL-LG-4";>;<;A类=";缩略图href=";~/首页/产品";style=";background-image:URL(/./images/image-370x370.JPG)";>;<;DIV类=";缩略图-标题<;H3类=";缩略图标题";>;电子商务<;/H3>;<;DIV类=";内缩略图";>;<;DIV类=";缩略图内容这是一个完整的电子商务解决方案,您可以通过它来管理您的在线商店。<;/DIV>;<;DIV类=";缩略图-图标FA-角度-右";>;<;/DIV>;<;/DIV>;<;/DIV>;<;/a>;<;/DIV>;

在第二行 <div class="col-sm-6 col-lg-4"><a class="thumbnail" href="~/home/products" style="background-image: url(/../images/image-370x370.jpg)"> <div class="thumbnail-caption"> <h3 class="thumbnail-heading">E-Commerce</h3> <div class="thumbnail-inner"> <div class="thumbnail-content"> this is a complete e-commerce solution through which you can manage your online store. </div> <div class="thumbnail-icon fa-angle-right"></div> </div> </div></a> </div>


顺晟科技:

您可以使用多个图像:

<picture>
  <source type="image/webp" srcset="flower.webp">
  <source type="image/jpeg" srcset="flower.jpg">
  <img src="flower.jpg" alt="">
</picture>

使用<;<;怎么样?背景图像:";图像集";>;>;比如:

style="background-image: url(/../images/image-370x370.jpg)"

这对我很有效。

  • TAG:
相关文章
随机推荐
我们已经准备好了,你呢?
2024我们与您携手共赢,为您的企业形象保驾护航