473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Aligning an image with the bottom of it's container

Hi all,

Is this possible? I have a simple DIV with some text and an image inside.
I want the text to wrap around the image, but I want the bottom of the
image to sit on the bottom of the DIV.

I know the size of the image, but not the size of the DIV.

Many thanks
Lister

Jul 21 '05 #1
3 2402
in comp.infosystems.www.authoring.stylesheets, Listerofsmeg wrote:
Hi all,

Is this possible? I have a simple DIV with some text and an image inside.
I want the text to wrap around the image, but I want the bottom of the
image to sit on the bottom of the DIV.

I know the size of the image, but not the size of the DIV.


Easy:

img {position:relative;top:-50px-;float:right;}

<div>text<img height=50></div>

I have no idea if it works. Most browsers seem to move floated box
around, when relatively positioned, but they should first do the
positioning and then floating.

But I could be missinterpreting the spec, this is 3am here and I didn't
check anything well.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Jul 21 '05 #2
RAM
CSS
..imgPlace{
float:right;
margin:5px 0px 0px 5px;
}

HTML
<div>all the text here...<img src="img.gif" class="imgPlace"/></div>

Jul 21 '05 #3
in comp.infosystems.www.authoring.stylesheets, RAM wrote:

[and snipped all text - usual way to make clear that reply don't answer
to any question asked]
CSS
.imgPlace{
float:right;
margin:5px 0px 0px 5px;
}

HTML
<div>all the text here...<img src="img.gif" class="imgPlace"/></div>


Of course, this don't work as OP wanted, mostly becuase image will
overflow.

Try with about 10 lines of text, and image that height is 5 lines, and
you see. What you did was 5px margin to right and bottom of image, that
has no relevance whatsoever.
--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: C.W | last post by:
I have a top box element that houses the web site title: #top_section { height: 20px; padding: 10px; text-align: left; background: navy; color: white; }
1
by: Larry Viezel | last post by:
http://nominex.com/bottomalign.htm I am viewing this page in IE. The expected behavior is that the image will align to the bottom of the div and that the text will wrap around the image. But...
8
by: Cardman | last post by:
I am hopeful that someone can quickly solve my image alignment issue when things are just not going right and where my attempts to solve this alignment issue have all failed. First of all take a...
6
by: tomasio | last post by:
Dear NG-readers, I want to align text right to an image. The last line of text should align with the bottom edge of the image. Unfortunately, the results using my poor CSS knowledge mounted in...
3
by: Sven C. Koehler | last post by:
Hello, the html below displays a box (#container) with a #footer and an #image inside. Is there any way how I could get rid of declaring max-width and max-height for the #image? The #image...
3
by: kk.simhadri | last post by:
Hi, I want to align some text to the bottom of page.I am doing this by a CSS class.It contains position:absolute; bottom:0; this does the purpose. but when I resize my page to smaller...
4
by: Corey Walker | last post by:
Hello: I am a webmaster for a non-profit organization. I do know some HTML, but I'm by no means an expert. Recently, many pages on our site were redesigned by a professional web designer, who...
1
by: tshad | last post by:
In VS 2008, I have in my footer a button, link and 2 images. But they are not displaying in the vertical middle of the row, even though I have it set that way: <asp:Button ID="AddQuestion"...
2
by: studentofknowledge | last post by:
For some unknown reason ie is placing images I have in a div in a weird way. One image is overlapping another but this problem is not occuring in mozilla. I have looked at my code over and over again...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.