我试图在我的rebecca紫色背景颜色上为我的jumbotron获得重复的背景图像。我知道我做错了什么,只是不知道它是什么。这是代码:
.jumbotron {
background-color: rebeccapurple;
color: white;
width: auto;
height: 350px;
margin-bottom: 100px;
position: relative;
display: block;
font-family: FontAwesome;
}
.jumbotron::after {
content: '';
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: url(\images\bg_images\maze_white.png) repeat center center;
z-index: -1;
}
感谢所有帮助。谢谢。
答案 0 :(得分:1)
由于z-index:-1,你的迷宫落后于jumbotron。你需要做的是交换周围的背景,就像这个小提琴http://jsbin.com/tekefobive/edit?css,output
.jumbotron {
background-image:url('pattern');
...
}
.jumbotron:after{
background:purple;
z-index:-1;
...
}
答案 1 :(得分:0)
< -130