[thelist] CSS positioning/flow

Dougal Campbell dougal at gunters.org
Mon Nov 11 12:03:07 CST 2002


On Mon, 11 Nov 2002, Chris Marsh wrote:

> Dear all
>
> If I have a number of "links" on a page consisting of an image and text
> title each (eg: <img src='foo.gif'><br /><a href='foo.htm'>Foo</a>) How
> can I get them to "flow" on the page? IOW, <span><a
> href='foo.htm'>Foo</a></span> gives me exactly what I want, but when I
> use a <br /> tag within the span, it drops the whole line down. The best
> way I can think of to describe what I want is a dynamic table; insomuch
> as the layout should be tabular, but instead of the <td> widths
> increasing when the window is resized they stay constant, but the number
> of <td>s on a line will increase or decrease.

Best bet is probably to use floated divs:

  <div style="float:left;text-align:center">
    <img src="foo.gif" /><br />
    <a href="foo.html">Foo!</a>
  </div>

Of course, it would be better to use a CSS class instead of inline
styles. I'll leave that as an excercise for the reader :)

--
Ernest MacDougal Campbell III, MCP+I, MCSE <dougal at gunters.org>
http://dougal.gunters.org/             http://spam.gunters.org/
  Web Design & Development:  http://www.mentalcollective.com/
       This message is guaranteed to be 100% eror frea!




More information about the thelist mailing list