Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Mobile websites are often developed separately from primary websites (those intended to be viewed on a desktop or laptop), although they may use much of the same content. To make sure your website is tailored for mobile devices, you’ll want to detect when a mobile device visits the site and then redirect the device to markup made especially for mobile. You may also want to deliver a website layout and content based on a specific mobile device. In this chapter, you’ll learn how to do both. Let’s begin by learning how to detect when a mobile device accesses your website.