How to create columns
-
Hi,
Contact List is shown as a 1 column list.
I share this CSS to create columns easily.
To change the number of columns it’s only necessary to change percentages and nth-child values#contact-list-search ul li { width: 32%; float: left; margin-right: 1%; } #contact-list-search ul li:nth-child(3n+1) { clear: left; } #contact-list-search ul li:nth-child(3n+0) { clear: right; } @media (max-width: 992px) { #contact-list-search ul li { width: 49%; float: left; margin-right: 1%; } #contact-list-search ul li:nth-child(2n+1) { clear: left; } #contact-list-search ul li:nth-child(2n+0) { clear: right; } } @media (max-width: 748px) { #contact-list-search ul li { width: 99%; float: left; margin-right: 1%; } #contact-list-search ul li:nth-child(1n+1) { clear: left; } #contact-list-search ul li:nth-child(1n+0) { clear: right; } }
Thanks
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘How to create columns’ is closed to new replies.