Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Responsive List

Featured Replies

Hi Gang ...

 

Working on a responsive list which adapts from 4 column to 3, 2, 1. Most of it is working fine but I have hit my age old problem of floated li getting caught on the floated li above with longer text ... I really want to put this to bed ... permanently.

 

The Fiddle - you can see the problem in the image below. I'm running out of ideas on how to do this. Help appreciated :D

post-36527-0-58556200-1373191643_thumb.jpg

The only thing I can think of is using mq to target each column change and nth child to clear the floats

 

I think this should work on with the image you posted

 

.foot-link li:nth-child(3n+4){clear:left;}

Probably not the best way (I also removed the float on the ul) see if thats what your after

 

@media only screen and (max-width: 800px) {
	.foot-link li {
	width: 32%;
	}
    .foot-link li:nth-child(3n+4){clear:left;}
    
}

@media only screen and (max-width: 600px) {
	.foot-link li {
	width: 49%;
	}
    .foot-link li:nth-child(3n+4) {
        clear:none;}
    .foot-link li:nth-child(2n+3) {clear:left;}
}

If you're ok with a javascript solution you could take a look here:

http://www.webdesignerforum.co.uk/topic/69443-how-to-make-your-auto-heights-equal/

The solution works with floating block elements but if you give your links a display block property you should be able to organize them in nice responsive coulums with this script

Edited by Nillervision

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.