Check out this code snippet
http://jsfiddle.net/qMXZv/1/
<div id="parent" style="position:relative;width:300px;height:300px;background: url(http://wallpaperplus.org/wp-content/gallery/019-wallpaper-wallpaper-03/desktop-wallpaper-52.jpg) repeat-x left top">
<img width=100 height=300 src="http://stichtingpani.nl/wp-content/uploads/2011/11/google_logo.jpg" align="left"> <!--align left-->
<span style="position:absolute;top:10px;"> "Some text A"</span> <!-- align on right top -->
<span style="position:absolute;bottom:10px;v-align:top;">"Some text B" </span><!-- align on right bottom -->
</div>
MODIFICATION
I have made some alterations to the example provided
REVISION 2
To achieve the desired outcome, ensure that your parent div has a position:relative
. This will cause all "absolute" positioned elements to be aligned relative to the container div, not the top right corner of the browser viewport.
Specify the width and height of the container div so that it occupies the necessary space for your design. This way, you can work with defined dimensions.
Add span containers for the text and position them absolutely at the top and bottom for proper alignment.
For the <img>
tag, utilize the align="left"
attribute to align it to the left, allowing text flow to the right.