H
Herbert Gerstinger
Hi,
I've got a problem that looks trivial but is quite tricky:
I have several pictures with different widths with corresponding describing
texts with different lengths.
The question is, how do I display this text under the picture, so that:
- it's centered under the picture
- the text does never, ever take more width than the picture
- the line-breaks are added automatically
Of course the most straightforward thing to do would be
<div>
<img src="pic.jpg">
<br><div align=center>My very long text</div>
</div>
or simply
<div align=center>
<img src="pic.jpg">
<br>My very long text
</div>
The problem is that the text is not broken (at least not in the browsers I
have tested) and the whole text is just displayed in a single line.
I've got a problem that looks trivial but is quite tricky:
I have several pictures with different widths with corresponding describing
texts with different lengths.
The question is, how do I display this text under the picture, so that:
- it's centered under the picture
- the text does never, ever take more width than the picture
- the line-breaks are added automatically
Of course the most straightforward thing to do would be
<div>
<img src="pic.jpg">
<br><div align=center>My very long text</div>
</div>
or simply
<div align=center>
<img src="pic.jpg">
<br>My very long text
</div>
The problem is that the text is not broken (at least not in the browsers I
have tested) and the whole text is just displayed in a single line.