Overlaying images using CSS -
i have following images:
,
and using css need show them on web page 1 image:
i.e. smaller image in right bottom corner of bigger image on top of it.
the size of bigger image not static - image different every time reload page.
wrap images in <div>
s display:inline-block; position: relative
. can absolutely position little badge images. example:
<div class="wrapper"> <img src="http://placekitten.com/200/200" width="200" height="200"> <img src="http://placekitten.com/50/50" width="50" height="50" class="badge"> </div> <div class="wrapper"> <img src="http://placekitten.com/250/200" width="250" height="200"> <img src="http://placekitten.com/25/50" width="25" height="50" class="badge"> </div>
and:
.wrapper { display: inline-block; position: relative; line-height: 0; } .badge { position: absolute; bottom: 0; right: 0; }
and live version: http://jsfiddle.net/ambiguous/seh6l/
the display: inline-block
, line-height
tightly wrap <div>
around main image have same size image, position: relative
needed position: absolute
on badges; absolutely position badge in lower right corner of <div>
, you're done.
Comments
Post a Comment