Hi Matt, 

No worries. Still missing it though! Text-align:center will align the
elements horizontally centered.

I want to align the elements INSIDE the li to be vertically centered to the
height of the li. 
So there is an even space above and below each of the elements inside the
li. At the moment they are sticking close to the top of the li.  

I cant use a top margin because the list is used more than once in the page
and the li's each have different heights. % value for margin-top seem to use
the document height and not the height of the li.

Basically I want to achieve the same effect as valign: middle in a table
cell.

I just can find a logical solution that will work with a non-fixed height
container.

It's looking to me like it cant be done without a table!

I wonder if there is a way of doing this with javascript?

Thanks.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Matt Fellows
Sent: 18 May 2008 02:58
To: wsg@webstandardsgroup.org
Subject: Re: [WSG] Centering all items in a li

Sorry Darren - it was late an i was tired! Vertical/Horizontal,
Left/Right...

I don't think there is a need to do anything too exciting, the container of
the list should just need a text-align:center.
Is this basically what you are after? I have made the div only 300px wide so
you get the wrapping effect which I think is what is causing the grief.

div.container{text-align:center; width:300px} div.container ol
li{list-style-type:none; }

<div class="container">
<ol>
       <li class="elem">
               <label for="dname">Display Name:</label>
               <input type="text" id="dname" class="tinput" />
       </li>
       <li class="desc">
               <p>Information about preview box etc. If it is more than two
lines or ## characters link to.</p>
               <span><a href="">learn more</a></span>
       </li>
</ol>
</div>

The list items will be centered. If you have multiple columns you can just
place them next to each other.
Or am i still missing something?

--
Matt Fellows
http://www.onegeek.com.au/


*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************



*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************

Reply via email to