Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Responsive Web Design

Responsive Web Design

I gave a 2-day workshop on Responsive Web Design at Ken Saro-Wiwa Innovation Hub alongside Ben Ogie. The workshop covered the basics of RWD and gave a hands-on experience on how it can be achieved.

Kelvin Gobo

January 16, 2018
Tweet

More Decks by Kelvin Gobo

Other Decks in Programming

Transcript

  1. • Personal computers became more popular • Sizes of PC

    became smaller each year • Mobile devices joined the party • Tablets came some time later
  2. Temporary solution If the user visits your website on a

    laptop, serve them the website Else if you detect a mobile device, serve them the mobile version
  3. Another temporary solution / / check the devices screen width

    If(screen.width <= 800) { window.location = “http:/ /m.example.com”; }
  4. “Responsive design is not about designing for mobile. But it’s

    not about designing for desktop either. Rather it’s about adopting a more flexible, design-agnostic approach.” Ethan Marcotte - Author of Responsive Web Design -
  5. Using media queries • Embed media queries in css •

    Link to css file when device matches a query
  6. / / Embed media queries in CSS body { background-color:

    red; } @media (max-width: 800px) { background-color: blue; } @media (max-width: 500px) { background-color: yellow; }
  7. / / Link to css file when device matches a

    query <link rel="stylesheet" href="weather.css"> <link rel="stylesheet" media="(max-width:600px)" href="weather-2-small.css">
  8. Mostly fluid The mostly fluid pattern consists primarily of a

    fluid grid. On large or medium screens, it usually remains the same size, simply adjusting the margins on wider screens.
  9. Column drop For full-width multi-column layouts, column drop simply stacks

    the columns vertically as the window width becomes too narrow for the content.
  10. Layout shifter Key to this layout is the way content

    moves about, instead of reflowing and dropping below other columns. Due to the significant differences between each major breakpoint, it is more complex to maintain and likely involves changes within elements, not just overall content layout.
  11. Off canvas Rather than stacking content vertically, the off canvas

    pattern places less frequently used content—perhaps navigation or app menus—off screen