Posted by Ben C on 10/27/06 09:24
On 2006-10-27, Knut Krueger <Etron777@web.de> wrote:
> Hi to all
> I would like to get the text exactly as wide as the image.
> http://pizza.einthal.de
>
> any hints for me?
You can set its container to the same width that the image happens to
be.
Or use
#unipizza {
display: table; width: 1px;
}
This will make the container's width as close to 1px as it can get
without overflowing. Since your image is wider than the longest
unbreakable character sequence, it'll get the width of the image.
If you then want those margins doing some centering (you had left and
right both set to 15em), add "margin: 0 auto" to the #unipizza selector
as well.
Navigation:
[Reply to this message]
|