Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Newby image/ text wrap question
December 18, 2006, 9:46 am
rate this thread
I'm new to html, and having difficulty getting my text to wrap around
an image the way I'd like it to..
I have an image in the top left corner of a component, and if there is
space, I'd like my text to start at the top right and wrap around the
image. However, if there is a long word in my text (which is longer
than the available space between the image and the left edge of the
component) the the image overlaps the text. Ideally I'd like the text
to begin under the image if one of more of the words are too long for
the available space.
An example of my current text snippet is as follows (note, the size of
the component is determined programmatically by my application):
So far I can only get the effect I want by adding it into a table - is
this the only way it is possible?
- Jukka K. Korpela
December 19, 2006, 8:35 am
Re: Newby image/ text wrap question
I think you have "left" and "right" swapped here, as compared with the rest
of the problem description.
This is an Internet Explorer bug.
That's what Firefox does.
Floated elements - whether you float them using align="..." attributes in
HTML or the float property in CSS - suffer from some implementation problems
that reduce their attractiveness.
In this case, however, it seems that the problem can be fixed by making the
block-level container (in your example, <p> element, but I would rather use
<div>, since an image does not really constitute a paragraph) floated,
rather than the image itself. You would need to set an explicit width for
the container, so you may need to modify the code that generates the page.
<div style="width: 270px; float: right"><img
alt="(Map of Dunfermline area.)"></div>
Jukka K. Korpela ("Yucca")