Introduction
To build a mobile-friendly website, the current trend is to use responsive design where the page adapts to the screen width. This way, the same page is nicely displayed on all devices: computers, tablets and mobiles.
Another approach, which this chapter covers, is to build a separate website for mobile devices. This requires building two pages (different HTML and distinct URLs) for each page of the website: one for the computer and one for the mobile. This extra work makes sense when:
Performance is important. For example, the loading time of a responsive website like https://www.flickr.com/ would be too long on mobile devices because of the high-resolution images of the desktop version. A separate mobile website makes it easier to optimize the user experience on mobile devices.
The computer version of the website already exists; in this case, it's usually much simpler to build a separate mobile website.
In this chapter, we'll cover how to serve different pages to mobile devices...