onlyican Posted June 2, 2010 Share Posted June 2, 2010 Hey all This is a little complex I have an Unordered List As we all know, list Elements display Down Page BUT I want to go across 3 then down 1, across 3 For Example, with the alphabet being my LIs A B C D E F G H I .... How would I do this in CSS or do I require JS Link to comment https://forums.phpfreaks.com/topic/203615-list-style-with-a-twist/ Share on other sites More sharing options...
haku Posted June 2, 2010 Share Posted June 2, 2010 Float them all left. Give every 3rd element (1, 4, 7, 10 etc) a special class. Set clear:left to that class. Link to comment https://forums.phpfreaks.com/topic/203615-list-style-with-a-twist/#findComment-1066581 Share on other sites More sharing options...
onlyican Posted June 3, 2010 Author Share Posted June 3, 2010 Found the method Have an outter div with a fixed with Then have the List Element class a fix width but float left Then when the Outter div limit is hit, the Lists will continue on a new line. Link to comment https://forums.phpfreaks.com/topic/203615-list-style-with-a-twist/#findComment-1067068 Share on other sites More sharing options...
nexprograms Posted June 4, 2010 Share Posted June 4, 2010 I think it cannot be done by css nakedly, but can be done using some trick by using some css class. Set css class to every next 3 alphabet li. <style type="text/css"> ul { list-style: none; } li { float: left; width: 20px; text-align: center; margin-left: 2px; } .down { clear: both; } </style> <ul> <li>A</li> <li>B</li> <li>C</li> <li class="down">D</li> <li>E</li> <li>F</li> <li class="down">G</li> <li>H</li> <li>I</li> <li class="down">J</li> <li>K</li> <li>L</li> <li class="down">M</li> <li>N</li> <li>O</li> </ul> Link to comment https://forums.phpfreaks.com/topic/203615-list-style-with-a-twist/#findComment-1067890 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.