Jump to content

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>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.