The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Mobile Device Trick Re: Mobile Device Trick


> So in that case how would I disable images for one page but not all pages? I have a slider that is slow to load on mobile and I would prefer to just skip it all together, but I want the rest of my content to be left alone. Or would it be better to do this in the PHP of the slider itself? Basically to just skip loading the images at all if the screen is not big enough.

There is a CSS solution: Give each page in your site a unique identifier and use that in the selector area for your rule in the media query. Using TopDoc’s example above, let’s pretend we want to do this in the “about us” page of our site, this is what the css would look like:

@media screen and (max-width: 480px)
body#about .poop #content #sidebar img { display: none; }