如何使用 css 设置覆盖全图的背景图片
how to set background image which cover full with using css
我正在尝试设置应该覆盖整个屏幕宽度的背景图像。目前它只覆盖整个宽度的百分之几。我用这个 css
.curve-img-container {
background-image: url("../src/bg-curvy-desktop.svg");
background-size: cover;
width: 100%;
height: 200px;
}
看起来像这样(全屏模式下看)代码沙盒link
但它应该是这样的
这是我的代码
https://codesandbox.io/s/affectionate-cartwright-pw2mq?file=/src/styles.css:157-174
我试过 firefox
.curve-img-container {
background-image: url("../src/bg-curvy-desktop.svg");
width: 100%;
height: 200px;
background-repeat: round;
}
我正在尝试设置应该覆盖整个屏幕宽度的背景图像。目前它只覆盖整个宽度的百分之几。我用这个 css
.curve-img-container {
background-image: url("../src/bg-curvy-desktop.svg");
background-size: cover;
width: 100%;
height: 200px;
}
看起来像这样(全屏模式下看)代码沙盒link
但它应该是这样的
这是我的代码
https://codesandbox.io/s/affectionate-cartwright-pw2mq?file=/src/styles.css:157-174
我试过 firefox
.curve-img-container {
background-image: url("../src/bg-curvy-desktop.svg");
width: 100%;
height: 200px;
background-repeat: round;
}