Gabriela Dias
Gabriela Dias

Reputation: 349

many images side by side in div background

I have 4 images and 1 div.

each image is different in their size:

img 1 200x400
img 2 600x500
img 3 900x1000
img 4 300x300

and div:

<style>
#divimgs{
 height:400px;
 width:800px;
}
</style>

the problem is, how can I put this 4 images as background in #divimgs, side by side and each image with the same size = height 400 and width 200 (200 per image = 800 width - same divimgs width)

thank you!

Upvotes: 2

Views: 2129

Answers (1)

Finduilas
Finduilas

Reputation: 742

This is possible in CSS3. You have to play with background-position, background-size.

#divimg {
background: url("image1.gif"), url("image2.gif"),url("image3.gif"),url("image4.gif");
background-size: 200px 400px;
background-repeat: no-repeat;
background-position: 0px 0px, 200px 0px, 400px 0px, 600px 0px}

Have a look for the property's on http://www.w3schools.com/cssref/

Upvotes: 3

Related Questions