Jump to content

List Style with a twist


onlyican

Recommended Posts

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

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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.