You are here: Re: div box questions; float text around a box, fit box to image size « HTML « IT news, forums, messages
Re: div box questions; float text around a box, fit box to image size

Posted by Els on 09/15/05 09:53

Gnarlodious wrote:

> Entity Els spoke thus:
>
>>> Is there a way to "float" text around a div box the way it can float around
>>> an image?
>>
>> yes, and it works exactly the same way. Give the div box a width and
>> float it like you would an image.
>
> Yes! It is working, however it appears there is no inline width declaration
> for div boxes. Since all my images are of varying width, what's the easiest
> way to do this?

Server side. Pick up the width/height of the image with php or another
server side scripting language, and take that width to go in the width
setting for the div. Obviously, you'd set the width for each div in an
inline style then, not in the stylesheet.

Without server side scripting it would just have to be coded by hand.

> Oddly, a div box knows how high an image is but not how wide!

If you'd float the div without setting a width, it actually would
'shrink-wrap' around the image. It's the caption that may cause it to
stretch wider than the image.

It doesn't necessarily know the height of the image, but it just
closes at the end of the content. Which is good, otherwise you could
never have flexible text-flow or font-size inside a div without
serious problems :-)

--
Els http://locusoptimus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Smokie - Wild Angels

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация