Set the distance from below, not from above. Or set it to%.
EDIT . I applied one of my experiments to an example: http://dabblet.com/gist/2787061 The description position is set relative to the bottom
and left
image container (the image fills its entire container).
In the first case, the distances to the left
and bottom
image container are fixed in px.
In the second case, they are in% and change when the browser window is resized.
Basically, the rules that do the trick,
figcaption { bottom: 5px; left: 23px; }
in the first case (fixed distances, in px) and
figcaption.perc { left: 10%; bottom: 17%; }
in the second case (in percent).
Also note that you do not need position: absolute
or set the top
and left
properties for the image. However, you need to set position:relative
in the parent description box.
For the image to fill the screen horizontally, you need to have margin:0;
and padding:0;
for the body element and width: 100%;
and margin: 0;
for a picture element. I edited my example to reflect these changes http://dabblet.com/gist/2787061
In order for the image to fill the screen both horizontally and vertically, the easiest way is to not even use the img tag, but simply set the image as a background image for the body and set the height for both html and the body of the elements to 100% - example http://dabblet.com/gist/2792929
Be careful for two reasons: one, this will really distort the image and can make it look ugly when you resize the browser window, and two, if you need some content below the image, you will need to provide an external position: absolute
element and set its top: 100%
Both of these aspects can be seen in the example to which I am attached. You can simply delete the content below the image if you do not need it.