Skip to site navigation (Press enter)

Re: [css-d] horizontal list elements evenly spaced ala

Devon Miller Fri, 08 Dec 2006 10:42:29 -0800

Toby Sutton wrote:
> anybody know how to evenly spaced a horizontal list with an arbitrary
> number of elements in the same manner that using a table will result in?

There are several approaces; here's a couple off the top of my head.
Both use the same html:
<ul>
      <li>Item 1</li>
      <li>Item 2</li>
             ...
      <li>Item N</li>
</ul>

You can choose fixed width columns (10 ems) and let the browser figure
out how columns will fit
li {
    float: left;
    width: 10em;
}

Or, you can choose how many rows (5 in this case) and let the browser
decide if it needs to wrap the contents to fit:
li {
    float: left;
    width: 20%;
}

dcm
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
  • Previous message
  • View by thread
  • View by date
  • Next message
  • Re: [css-d] horizontal list elements evenly spaced ala ... Zoe M. Gillenwater
    • Re: [css-d] horizontal list elements evenly spaced... Devon Miller

Reply via email to

The Mail Archive
  • The Mail Archive home
  • css-d - all messages
  • css-d - about the list
  • Expand
  • Previous message
  • Next message
  • The Mail Archive home
  • Add your mailing list
  • FAQ
  • Support
  • Privacy
  • [email protected]