18.11.2015 Views

Beginning Drupal 8

Todd Tomlinson - Beginning Drupal 8 (The Expert's Voice in Drupal) - 2015

Todd Tomlinson - Beginning Drupal 8 (The Expert's Voice in Drupal) - 2015

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 18 ■ Creating a Responsive Site<br />

Figure 18-1. Normal laptop screen resolution<br />

Open that same page on an iPhone and the columns shrink to 33% of 320 pixels, or approximately<br />

106 pixels. The columns become narrow and long, and the text within the columns becomes unreadable—<br />

or at best the viewer has to scroll left and right to see very small columns of very small text and images<br />

(see Figure 18-2).<br />

Figure 18-2. Normal iPhone 4 screen resolution<br />

A better approach would be to detect that the user is viewing the site on a device that is 320 pixels wide<br />

and, instead of offering three columns horizontally spread across the page, make each column 320 pixels<br />

wide (or 100% of the width) and stack the columns on top of each other. At 320 pixels wide, each column is<br />

nearly as wide as viewing that column on a 15-inch laptop screen, still very readable on an iPhone 4<br />

(see Figure 18-3).<br />

194

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!