Skip to content Skip to sidebar Skip to footer

How To Sort List In Vertical?

I'm using this below HTML and CSS code to sort list in vertical , the output is horizontal sorted. My example code:

Solution 1:

Use CSS columns: (JSFiddle)

ul {
    column-width: 380px;
    -webkit-column-width:380px;
    -moz-column-width: 380px;
    height:440px;
}

#tiles {
    list-style: none;
    margin: 0px;
}
#tilesli {
    /* float: left; */margin: 20px;
    width: 300px;
    height: 200px;
    background-color: #dddddd;
    font-size: 72px;
    text-align: center;
    vertical-align: middle;
}

Note that this won't work in IE≤9.

Solution 2:

CSS

#tiles {         
        list-style: none;        
        margin: 0px; 
        width:300px;
        height:200px;   
          }     
     ul   {
        column-width: 85px;
        -webkit-column-width:85px;
        -moz-column-width: 85px;
        height:60px;
         }

    #tilesli {         
        float: left;
        margin: 20px;        
        width: 50px;         
        height: 30px;         
        background-color: #dddddd;         
        font-size: 16px;         
        text-align: center;         
        vertical-align: middle;     }

See the fiddle

This is shroud as your output image

Post a Comment for "How To Sort List In Vertical?"