Background x-repeat negative margin for overlap

此生再无相见时 提交于 2019-12-12 08:59:31

问题


Actually my first question on stack:)

I'm trying to get a negative (right) margin on my repeating background, so there won't be a gap between the repeating images.

It seems there is no css syntax for this.

To make things clear, i added an image below. So i'm trying to get the repeating images of the cookie-like things to overlap so there's no gap between them.

screenshot of the page


回答1:


You can apply multiple backgrounds to an element, so why not use this background image twice, with different horizontal offsets.

body {
  min-height:170px;
  background:
    url('http://i.stack.imgur.com/jKAKB.png') 0 100% repeat-x,
    url('http://i.stack.imgur.com/jKAKB.png') 75px 100% repeat-x;
}

PS the cookie like things are called kruidnoten. Although everybody calls then pepernoten, which is not actually true.



来源:https://stackoverflow.com/questions/33593296/background-x-repeat-negative-margin-for-overlap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!