将具有CSS变换属性的图像用作Div背景

时间:2018-11-20 13:25:36

标签: html css twitter-bootstrap css3 bootstrap-4

我正尝试使用具有CSS transform属性的图像作为div的背景,并使用Bootstrap的.row.col

我遇到的问题是在CSS中引用图像进行转换,我需要HTML页面中的图像src,但要将图像用作行的背景,则需要将其链接到CSS。

我的代码对图像进行了轻微缩放。 https://codepen.io/jvern22/pen/xQPrwb

缩短;

.item:hover img {
    -moz-transform: scale(1.1);
    -webkit-transform: scale(1.1);
    transform: scale(1.1);
}

我的格式化文本看起来像这样; https://codepen.io/jvern22/pen/JeOJKY

缩短;

<div class="row">

  <div class="col-sm-6 features-box wow fadeInLeft">

    <div class="row">

      <div class="col-sm-3 features-box-icon">
        <i class="fas fa-globe-americas"></i>                  
      </div>

      <div class="col-sm-9">
        <h3>Your Own Web Address</h3>
        <p>
          You can even have your tour files hosted by us with a web address just for your tour!
        </p>
      </div>

    </div>
  </div>

  <div class="col-sm-6 features-box wow fadeInLeft">

    <div class="row">

      <div class="col-sm-3 features-box-icon">
        <i class="fas fa-globe-americas"></i>                  
      </div>

      <div class="col-sm-9">
        <h3>Your Own Web Address</h3>
        <p>
          You can even have your tour files hosted by us with a web address just for your tour!
        </p>
      </div>

    </div>
  </div>

</div>

0 个答案:

没有答案