How to add two background images - left and right from center column

后端 未结 3 2058
面向向阳花
面向向阳花 2021-02-08 21:44

I have this css:

#wrapper1 {
min-width:1020px;
min-height:100%;
}
#wrapper2 {
height:100%; 
background: url(\'img1.jpg\')         


        
3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-08 22:38

    You can use two absolute DIVs with two backgrounds. One left center and another one right centered:

    Place the DIVs wherever you want in the site. (they are absolutely positioned)

    HTML:

    CSS:

    .background{
        height: 100%;
        left: 0;
        position: absolute;
        top: 0;
        width: 100%;
        z-index: -1;
    }
    
    #background1{
        background: url(yourImage1.jpg) no-repeat 100% 0;
    }
    
    #background2{
        background: url(yourImage2.jpg) no-repeat 0 0;
    }
    

提交回复
热议问题