你能在背景图像重复之间创建空间吗? [英] can you create space between background image repeats?

查看:236
本文介绍了你能在背景图像重复之间创建空间吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以重复背景图片,但在下一个重复开始之前指定多个像素。

Is it possible to repeat a background image, but specify a number of pixels before the next repeat starts.

background:url(img.png) [after 40px] repeat-x;

i.e. background: url(img.png) [after 40px] repeat-x;

我不想为图片添加空白。

I don't want to add empty space to the image.

推荐答案

background-repeat: space;
background-repeat: round; // round(520 / 100) = round(5.2) = 5

在空间中,但将图像宽度调整为104像素(520像素/ 5)。使图像更宽以适合容器。 此处详细信息
或阅读
< a href =http://www.sitepoint.com/css3-background-size-property/ =nofollow>背景大小属性

The browser will render five images in the space but adjust the image width to 104px (520px / 5). The image is made wider to fit the container. Full details here or read Background Size property

这篇关于你能在背景图像重复之间创建空间吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆