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 Link to comment https://forums.phpfreaks.com/topic/216994-spacing/ Share on other sites More sharing options...
haku Posted October 27, 2010 Share Posted October 27, 2010 li { float:left; width:500px; } Link to comment https://forums.phpfreaks.com/topic/216994-spacing/#findComment-1127129 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) Link to comment https://forums.phpfreaks.com/topic/216994-spacing/#findComment-1127335 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. Link to comment https://forums.phpfreaks.com/topic/216994-spacing/#findComment-1127379 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 Link to comment https://forums.phpfreaks.com/topic/216994-spacing/#findComment-1129801 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.