See how the tiny Facebook icon is positioned in the lower right-hand corner over another image?
How can I do that using a combo of HTML/CSS/Rails/Prototype!? An example would be great. Perhaps in jsfiddle.net.
As the simplest solution. That is: Create a relative div that is placed in the flow of the page; place the base image first as relative so that the div knows how big it should be; place the overlays as absolutes relative to the upper left of the first image. The trick is to get the relatives and absolutes correct.
Basically, you put both of your images in the same container. Give the container a position that isn't static (in my example, relative). Then give the overlay image position: absolute and position it however you want using bottom and right . Show activity on this post.
To insert an image in HTML, use the image tag and include a source and alt attribute. Like any other HTML element, you'll add images to the body section of your HTML file. The HTML image element is an “empty element,” meaning it does not have a closing tag.
You can use css to solve the problem.
div { position: relative; display: inline; } .imtip { position: absolute; bottom: 0; right: 0; }
<div> <img src="http://i.stack.imgur.com/Blaly.png" /> <img src="http://www.w3schools.com/favicon.ico" class="imtip" /> </div>
Basically, I've done more or less what ZDYN said, just that you need to include a display: inline
in the container otherwise the container div
spans the whole width.
Here's a simple example using divs instead of images: http://jsfiddle.net/sqJtr/
Basically, you put both of your images in the same container. Give the container a position that isn't static (in my example, relative). Then give the overlay image position: absolute
and position it however you want using bottom
and right
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With