Responsive: Collapse table-cell DIVs to blocks is not working

I have DIVs displayed as a table in my footer in order to make 4 columns. At < 800 pixels, I want them to break down into blocks. However, for some reason my code is not working. I can’t figure out why. I can’t even get them to display: none. Any thoughts? Thanks.

#footer { width: 100%; max-width: 1160px; margin: 0 auto; color: #FFF; font-size: 1.7rem; line-height: 2.4rem; display: table; table-layout: fixed; } .footer-col { display: table-cell; } @media screen and (max-width: 799px) { /* This isn't working for some reason */ #footer { display: block; } .footer-col display: block; } }

<div id="footer"> <div id="footer-col1" class="footer-col"> <a href="/dev/" class="logo"><span class="logo-compare">compare</span><span class="logo-wear">wear.</span><span class="logo-com">com</span></a> <strong>Website</strong><br> <a href="/about/">About</a> <a href="/contact/">Advertising</a> <a href="/contact/">Contact</a> </div> <div id="footer-col2" class="footer-col"> <strong>Smartwatches</strong><br> <a href="/dev/wearables/?vs=watch">Apple&nbsp;Watch</a> <a href="/dev/wearables/?vs=peak">Basis&nbsp;Peak</a> <a href="/dev/wearables/?vs=surge">Fitbit&nbsp;Surge</a> <a href="/dev/wearables/?vs=vivoactive">Garmin&nbsp;Vívoactive</a> <a href="/dev/wearables/?vs=gWatch">LG&nbsp;G&nbsp;Watch</a> <a href="/dev/wearables/?vs=gWatchR">LG&nbsp;G&nbsp;Watch&nbsp;R</a> <a href="/dev/wearables/?vs=moto360">Motorola&nbsp;Moto&nbsp;360</a> <a href="/dev/wearables/?vs=pebble">Pebble&nbsp;Smartwatch</a> <a href="/dev/wearables/?vs=pebbleSteel">Pebble&nbsp;Steel</a> <a href="/dev/wearables/?vs=gear2">Samsung&nbsp;Gear&nbsp;2</a> <a href="/dev/wearables/?vs=gearLive">Samsung&nbsp;Gear&nbsp;Live</a> <a href="/dev/wearables/?vs=gearS">Samsung&nbsp;Gear&nbsp;S</a> <a href="/dev/wearables/?vs=smartwatch">Sony&nbsp;Smartwatch&nbsp;3</a> <a href="/dev/wearables/?vs=activite">Withings&nbsp;Activité</a> <a href="/dev/wearables/?vs=activitePop">Withings&nbsp;Activité&nbsp;Pop</a> </div> <div id="footer-col3" class="footer-col"> <strong>Fitness Bands</strong><br> <a href="/dev/wearables/?vs=charge">Fitbit&nbsp;Charge</a> <a href="/dev/wearables/?vs=chargeHR">Fitbit&nbsp;Charge&nbsp;HR</a> <a href="/dev/wearables/?vs=flex">Fitbit&nbsp;Flex</a> <a href="/dev/wearables/?vs=vivofit">Garmin&nbsp;Vívofit&nbsp;2</a> <a href="/dev/wearables/?vs=vivosmart">Garmin&nbsp;Vívosmart</a> <a href="/dev/wearables/?vs=up24">Jawbone&nbsp;UP24</a> <a href="/dev/wearables/?vs=up3">Jawbone&nbsp;UP3</a> <a href="/dev/wearables/?vs=band">Microsoft&nbsp;Band</a> <a href="/dev/wearables/?vs=gearFit">Samsung&nbsp;Gear&nbsp;Fit</a> <a href="/dev/wearables/?vs=smartband">Sony&nbsp;SmartBand</a> <a href="/dev/wearables/?vs=smartbandTalk">Sony&nbsp;SmartBand&nbsp;Talk</a> <br> <strong>Other Activity Trackers</strong><br> <a href="/dev/wearables/?vs=one">Fitbit&nbsp;One</a> <a href="/dev/wearables/?vs=zip">Fitbit&nbsp;Zip</a> <a href="/dev/wearables/?vs=upMove">Jawbone&nbsp;UP&nbsp;Move</a> <a href="/dev/wearables/?vs=flash">Misfit&nbsp;Flash</a> <a href="/dev/wearables/?vs=shine">Misfit&nbsp;Shine</a> </div> <div id="footer-col4" class="footer-col"> <strong>Random Wearables</strong> <a href="/dev/wearables/?vs=watch&amp;vs=gWatchR" class="randomLink"> Apple Watch<br><span class="vs"> vs. </span> LG G&nbsp;Watch&nbsp;R</a> <a href="/dev/wearables/?vs=gWatch&amp;vs=gearS&amp;vs=smartband" class="randomLink"> LG G&nbsp;Watch<br><span class="vs"> vs. </span> Samsung Gear&nbsp;S<br><span class="vs"> vs. </span> Sony SmartBand</a> <a href="/dev/wearables/?vs=watch&amp;vs=chargeHR&amp;vs=up3&amp;vs=pebbleSteel" class="randomLink"> Apple Watch<br><span class="vs"> vs. </span> Fitbit Charge&nbsp;HR<br><span class="vs"> vs. </span> Jawbone UP3<br><span class="vs"> vs. </span> Pebble Steel</a> <a href="/dev/wearables/?vs=one&amp;vs=zip&amp;vs=band&amp;vs=gearS&amp;vs=activitePop" class="randomLink"> Fitbit One<br><span class="vs"> vs. </span> Fitbit Zip<br><span class="vs"> vs. </span> Microsoft Band<br><span class="vs"> vs. </span> Samsung Gear&nbsp;S<br><span class="vs"> vs. </span> Withings Activité&nbsp;Pop</a> </div> </div>

Look at this rule (copy pasted.)

.footer-col
display: none;
}

Where is that? That’s in my code above? I don’t see it.

Look at your live copy. Your code you posted there, and your live copy, do not match up. Please get the live copy up with yoru current code you just posted. I can’t debug two versions that are different :slight_smile: .

Your style.css page. It has this (copy pasted.)

@media screen and (max-width: 799px) { /* This isn't working for some reason */
	.footer-col
		display: none;
	}
}

Ah. Thank you. Darn brackets. I hate typos.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.