Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'd try to use <code>display: inline-block;</code> to style the elements containing each image. Example of HTML code for one container:</p> <pre> &lt;style&gt; .figure { display: inline-block; } &lt;/style&gt; &lt;div class="figure"&gt; &lt;img src="littlepony.jpg" alt="My cute little pony" width="13" height="37" /&gt; &lt;/div&gt; </pre> <p>Now there a few pitfalls using this with IE6, IE7 and Firefox 2:</p> <ul> <li>IE 6 and 7 will only style inline elements that have hasLayout triggered, I mean you'll see inline-block <em>behavior</em> if you do this:</li> </ul> <pre> &lt;!--[if lte IE 7]&gt; .figure { display: inline; zoom: 1; /* triggering hasLayout */ } &lt;![endif]--&gt; </pre> <ul> <li>Firefox 2 doesn't understand <code>display: inline-block;</code> so you'll have to precede the latter by another display instruction:</li> </ul> <pre> .figure { display: -moz-inline-stack; display: inline-block; } </pre> <ul> <li>now Firefox 2 is going to annoy you a bit. First, you must have only one child element in your <code>.figure</code> element, otherwise the children would ... stack. So if you have a legend under your image, insert a div between div.figure and img+p</li> </ul> <pre> &lt;div&gt; &lt;img src="littlepony.jpg" alt="Photo of my cute little pony" width="13" height="37" /&gt; &lt;p>Second child of .figure&gt;div and not .figure&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </pre> <p>Second (still only in Fx2), you'll notice from time to time that you can't anymore neither select text inside the -moz-inline-stack'ed element nor click on links it could contain. The fix is to position the added div relatively:</p> <pre> .figure div { position: relative; } </pre> <p>Of course the conditional comment for IE6/7 must occur after regular CSS, otherwise it'll be of little help.</p> <p>And finally, if no elegant solution works for you, use a TABLE. A simple table with only td and no th. If it occurs that: </p> <ul> <li>IE6 and 7 don't like <code>display: table-sth</code></li> <li>your CMS causes problems to what would otherwise work fine on another site</li> <li>Firefox 3 support for <code>inline-block</code> is of no help</li> </ul> <p>than yes it's better for everybody that you use a table and no half-solution causing problems to half your users ;)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload