How do I join 3 backgrounds?

Asked

Viewed 87 times

1

The thing is, I have a div with id="1". And I have three images, with 20 pixels each that I want to be my backgrounds, but I want my div to have all three backgrounds, so on the left side of each other. In other words, when one ends, the other begins at your side.

How can I do that?

Thank you.

  • Check this link for help http://answall.com/questions/10627/css-v%C3%A1rios-backgrounds

  • I intend it to be one on the left side of the other, and no spacing.

  • @Gonçalo It wouldn’t be easier to join backgrounds in Photoshop?

1 answer

1

You can use the background for this purpose, as the following example

body {
    background: url("https://dummyimage.com/210x200/1eff00/fff&text=imagem+1") left top,
    url("https://dummyimage.com/210x200/0062e3/fff&text=imagem+2") center top no-repeat,
    url("https://dummyimage.com/210x200/f7c600/fff&text=imagem+3") right top no-repeat;
    
    background-repeat:no-repeat;   
    background-color: #cccccc;
}

Original code from here.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.