简体   繁体   English

缩放时背景重复停止

[英]background-repeat stops when zooming

I've set the background of my footer to background-repeat: repeat-x but for some reason when I zoom in, the background stops repeating... The blue bar you see should be repeating the whole width of the window according to the CSS rules (and he does, execpt when I start zooming in) 我已经将我的页脚background-repeat: repeat-x设置为background-repeat: repeat-x但是由于某种原因,当我放大时,背景停止重复...你看到的蓝色条应该重复窗口的整个宽度根据CSS规则(他确实在我开始放大时执行)

Is this normal? 这是正常的吗? If yes, how can I prevent or pass by this. 如果是,我该如何防止或通过这个。 If not, what could be the cause? 如果没有,原因可能是什么?

在此输入图像描述

EDIT: I just figured out if you set the width of the body to eg 1,000px or 5,000px the footer starts expanding, but when I zoom out to the normal size, the site is extremely large... And width: 100% didn't work out either. 编辑:我只是弄清楚,如果你将身体的宽度设置为例如1,000px或5,000px页脚开始扩展,但是当我缩小到正常大小时,网站非常大...并且width: 100%没有也没事。

Give the footer a width of 100% and then give it a min-width equal to the width of your content. 页脚宽度为100%,然后给它一个等于内容宽度的最小宽度。 So if your content has a fixed width of 960px for example, your css would be: 因此,如果您的内容的固定宽度为960px,那么您的css将为:

#content { width: 960px; }
#footer { width: 100%; min-width: 960px; }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM