html - 两张背景图片之间的空格

html - 两张背景图片之间的空格,第1张

我第一次在wordpress上工作。我正在尝试将标题添加到背景图像中。标题应如下所示。 html - 两张背景图片之间的空格,enter image description here,第2张

直到现在我才能达到这个水平。 html - 两张背景图片之间的空格,enter image description here,第3张

我想在两张图片之间留出空间,怎么做? 我的CSS

.page-id-157 .widget-title{
height: 45px;
padding-left:70px;

    background-image: url('images/stripe_red_diagonal.png'),url('images/logo_outline_black.png');
    background-repeat: no-repeat;
     background-position:20px 10px;
    }

如何在两个背景图像之间留出空间?任何帮助,将不胜感激。

最佳答案:

1 个答案:

答案 0 :(得分:1)

您需要修改由background-position

分隔的第二张图片的,

150px是距图像起点的水平偏移,应大于第一张图像的大小。

.widget-title {
  height: 45px;
  padding-left: 70px;
  background-image: url('http://placehold.it/100x100'), url('http://placehold.it/100x100/333');
  background-repeat: no-repeat;
  background-position: 20px 10px, 150px 10px;
}
<div class="widget-title"></div>

DABAN RP主题是一个优秀的主题,极致后台体验,无插件,集成会员系统
教程弟学习网站 » html - 两张背景图片之间的空格

0条评论

发表评论

提供最优质的资源集合

立即查看 了解详情