Search code examples
cssimageposition

Put img tag inside the top right corner of a div


I'd like to put a <a href="..."><img /></a> tag (linked image) in the top right corner of an existing div.

I've found a way to put an image as the background with no-repeat, but then, I cannot link the image. What CSS shall I use?

This is what I do have now:

<div id="footer">
  some multi-line commercial text content
</div>

and the css:

#footer
    {
        line-height:18px;
        position:absolute;
        bottom:-230px;
        left:0;
        width:280px;
    }

#footer span
    {
        font-size:16px;
        display:block;
    }

The icon I want to put there and link is 43x38 size. The footer div is 280x186 size (in the google chrome webmaster stuff).


Solution

  • Make the container position:relative

    Make the image position:absolute;right:0px;