Chapter 7. Sending Different Content to Different Devices
We have started looking at how different content might be needed for different devices in the context of images—in the previous chapter we explored some ways to send smaller image files to mobiles.
But that didn't actually change the user's experience on the mobile device, apart from speeding things up. What if we want to give the user something different, according to the device they're using? Maybe, they will need to access particular pages quickly, which will mean a change to navigation, or there will be interactions or animations on the desktop site that slow things down, take up space, and aren't necessary for users.
In this chapter we'll learn how to deliver different content according to the device, using CSS and PHP. Specifically we'll perform the following:
We'll learn how to hide elements using CSS (and why this method may not always be the best approach)
We'll use conditional PHP again to send different content to different...