重复CSS背景图片而无需拉伸 [英] Repeating CSS background images without stretching

查看:59
本文介绍了重复CSS背景图片而无需拉伸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以使用重复的图像创建平铺的背景,而无需拉伸和更改大小?

Is there a way create a tiled background using a repeating image without it stretching and changing size?

我有一个用作背景的图案.但是,我希望此内容在整个网站上始终如一地显示.目前,该模式可以正确重复,但是会根据容器的大小进行拉伸.

I have a pattern which I am using as a background. However I want this to display consistently throughout the site. Currently the pattern repeats correctly, but stretches depending on the size of the container.

推荐答案

仅供其他可能会遇到此问题的人参考...

Just for reference to anyone else who might find themselves with this problem...

这是因为我正在使用SVG.更改为常规图像文件,现在一切正常.

It was because I was using a SVG. Changed to a regular image file and now everything is fine.

这篇关于重复CSS背景图片而无需拉伸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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