I have three images which I want to overlay (with HTML + CSS, I do not want to use javascript if possible):
This is the result which I would like to achieve:
[image4]
This is what I have tried:
CSS:
.imageContainer {
position: relative;
}
#image1 {
position: absolute;
top: 0;
z-index: 10;
border: 1px solid blue;
}
#image2 {
position: absolute;
top: 0;
z-index: 100;
border: 1px solid fuchsia;
}
#image3 {
position: absolute;
top: 0;
z-index: 1000;
width: 10%;
height: 10%;
border: 1px solid green;
}
HTML:
<div class="imageContainer">
<img id="image1" src="https://i.sstatic.net/Es4OT.png"/>
<img id="image2" src="https://i.sstatic.net/WQSuc.png"/>
<img id="image3" src="https://i.sstatic.net/Xebnp.png"/>
</div>
image1: "main" image (image1 should set max height and max width for an imageContainer - se HTML above) [blue border]
image2: horizontal-align: center;
and top: 0;
relative to image1 [pink border]
image3: resized by 10% from its' origin size, horizontal-align: center;
relative to image1 [green border]
My error prone HTML + CSS resulted in this:
I can't figure out how my CSS should be. What should I do to achieve a result like [image4]?
css3
to tags becouse If you want manipulate this elements with only html and css you need css3.