我已经在CSS中尝试了background-image标记,也在HTML中的标记中尝试过。我无法在封装器后面看到任何内容。我可以让我的包装背景显示颜色,但它。
html,
body {
background-image: url("https://vgy.me/u/TpG24N");
text-align: center;
height: 100%;
}
#wrapper {
margin: 2% auto;
width: 875px;
height: 80%;
box-sizing: border-box;
background-color: rgb(250, 194, 245)
}
#subwrapper {
position: relative;
}
你的背景图片网址https://vgy.me/u/TpG24N
不是指图像,你的意思是https://vgy.me/TpG24N.jpg
html,
body {
background-image: url("https://vgy.me/TpG24N.jpg");
text-align: center;
height: 100%;
}
你在#wrapper
中设置了一个背景颜色,它不会显示任何东西。只需设置:
#wrapper{
background-color: transparent;
}
现在#wrapper
背后的元素将显示出来。
Edit`:
如果你愿意,你也可以制作semi-transparent
,保持你的颜色并将opacity
设置为0到1之间的值,如下所示:
#wrapper {
background-color: rgb(250, 194, 245)
opacity: 0.5;
}
现在#wrapper
将具有半透明的颜色。尝试使用正确的不透明度值,直到看起来像你想要的那样。
您没有添加图片扩展程序网址
html,body {
background-image: url("https://vgy.me/u/TpG24N");
text-align: center;
height: 100%;
}
另外,需要添加
#wrapper{
background-color: transparent;
}