codingmasterRS Posted October 27, 2010 Share Posted October 27, 2010 How can I automatically space out items <li> so they evenly spread out in a specified width (e.g. 500px)? Thanks in advance Quote Link to comment Share on other sites More sharing options...
haku Posted October 27, 2010 Share Posted October 27, 2010 li { float:left; width:500px; } Quote Link to comment Share on other sites More sharing options...
codingmasterRS Posted October 28, 2010 Author Share Posted October 28, 2010 haku thanks, BUT this does not make all the elements (<LI>) within a <ul> space out to consume an entire width (e.g. 500px) Quote Link to comment Share on other sites More sharing options...
haku Posted October 28, 2010 Share Posted October 28, 2010 Ahh I see, you want them to dynamically space out to be 500px. Can't be done through CSS alone. You will need to use some server-side logic to do this if you want. You will have to count the number of list elements in your server-side script, divide 500 by the number of elements, then use your server-side script to add a style tag with the width into each of your elements. Quote Link to comment Share on other sites More sharing options...
codingmasterRS Posted November 3, 2010 Author Share Posted November 3, 2010 Okay then can someone please provide a link to a tutorial or source code that will achieve what I want. Thanks in advance Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.