我有一个固定的背景,我想将另一个背景居中。我有以下代码:
HTML
<section id="contacto" class="section-padding">
<div class="page-relative">
<div class="bg-overlay">
<div class="bg-orange">
</div>
</div>
</div>
</section>
CSS
#contact {
background: url('../img/bg/background-1.png');
padding-top: 150px;
padding-bottom: 150px;
padding-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
margin-left: 0px;
color: #ffffff;
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
background-position: 50% 50%;
}
#contact .page-relative {
position: relative;
}
#contact .bg-overlay {
width: 100%;
height: 100%;
padding-top: 250px;
padding-bottom: 250px;
position: relative;
}
#contact .bg-orange {
background: url(../img/bg/background-2.png);
background-repeat: no-repeat;
width: 1215px;
height: 624px;
position: absolute;
padding-top: 150px;
padding-bottom: 150px;
top: -100px;
}
固定背景有效,但我无法将背景居中。如何将背景2居中?
非常感谢您的帮助。