我可以将背景图像剪切几个像素吗?

时间:2017-03-20 15:12:06

标签: css background-image

我有背景图像的重复图案。它是一系列对角线。当图像在背景中平铺时,图案不会排成一行。我是否必须进入并编辑图像以使它们排成一行,或者是否有办法来剪辑"他们使用background- CSS属性?



h2 {
      margin: auto;
      margin-left: auto;
      margin-right: auto;
    }
    .orange-title-bar {
      width: 100%;
      display: flex;
    }
    .orange-title-bar:before, .orange-title-bar:after {
      background: url(../images/patterns/Pattern-YELLOW.png);
      content: '';
      flex: 1;
    } 

<span class="orange-title-bar">
      <h2>
        Title
      </h2>
    </span> 

    
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

听起来你可能更喜欢在容器中简单地“移动”图像:

background: url(../images/patterns/Pattern-YELLOW.png) 5px 10px;

例如?

相关问题