mardi 31 mars 2015

HTML/CSS - Positioning tag from the right side of container, and to the right of another tag

I have a web page that has a div container with 3 images. Image 1 fills up the height of the container on the left side. Image 2 is centered in the container, but to the right of Image 1. Image 3 is in the bottom right corner of the container. I would like Image 3 to always be to the right of Image 1. Is there a way to achieve this using html/css? Currently if I resize the window, Image 3 covers up (or is covered by) Image 1 (depending on the 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>

Aucun commentaire:

Enregistrer un commentaire