HTML/CSS - Positioning tag from the right side of container, and to the right of another tag -
i have web page has div container 3 images. image 1 fills height of container on left side. image 2 centered in container, right of image 1. image 3 in bottom right corner of container. image 3 right of image 1. there way achieve using html/css? if resize window, image 3 covers (or covered by) image 1 (depending on z-index).
sample illustration:
- - - - - - - - | | | | | | | | - - | | | | - - | | | | | - - | | | | - - | - - - - - - - -
sample code:
<div background="{some background}" style="width: 100%; height: 750px; position: relative; background: {some background};"> <img src="{some image 1}" style="position: absolute; width: auto; height: 100%; left: 0px; z-index: 1;"> <img src="{some image 2}" style="position: absolute; width: 456px; height: auto; margin: auto; top: 0; left: 432px; bottom: 0; z-index: 2;"> <img src="{some image 3}" style="position: absolute; width: 456px; height: auto; margin: auto; bottom: 25px; right: 25px; z-index: 2;"> </div>
the easy way set min-width on parent div
<div background="{some background}" style="width: 100%; min-width: 912px; height: 750px; position: relative; background: {some background};"> <img src="{some image 1}" style="position: absolute; width: 456px; height: 100%; left: 0px; z-index: 1;"> <img src="{some image 2}" style="position: absolute; width: 456px; height: auto; margin: auto; top: 0; left: 432px; bottom: 0; z-index: 2;"> <img src="{some image 3}" style="position: absolute; width: 456px; height: auto; margin: auto; bottom: 25px; right: 25px; z-index: 1;"> </div>
note work best when define img 1's width set min width 2 images added together.
Comments
Post a Comment