早上好,
很抱歉打扰基本问题,但我需要在背景上用纯色和死点上的一个图形进行纯色设计。我所做的是在台式PC上工作,但不幸的是,当我在手机或平板电脑上预览时,图形被剪切了。
我做了什么:
body {
background-color: #000;
background-image: url(static/images/coming-background.jpg);
background-position: center center;
background-size: fixed;
background-attachment: fixed;
background-repeat: no-repeat;
}
谢谢
将background-size
属性设置为inherit
或initial
对我有用:
body {
background-color: #000;
background-image: url(static/images/coming-background.jpg);
background-position: center;
background-size: inherit;
background-attachment: fixed;
background-repeat: no-repeat;
}
演示