Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Responsive Web Design in a Nutshell
Search
Erik Frisk
September 05, 2013
Programming
470
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Responsive Web Design in a Nutshell
Erik Frisk
September 05, 2013
Transcript
26 slides
Responsive Web Design ... in a nutshell. leanmachine.se ▪
[email protected]
▪ 2013-09-06
What’s all the fuss about?
None
Our websites need to work on all devices
Responsive vs. Adaptive
Responsive vs. Adaptive Layout is fluid. Media queries are used
to change the layout when it “breaks down”
Responsive vs. Adaptive A set of pre-defined layout widths is
used. No fluid layout. Layout is fluid. Media queries are used to change the layout when it “breaks down”
http://liquidapsive.com/ Super sweet demo
Mixed Approach Fixed width layouts for large and medium. Fluid
layout for small.
How do I make my site responsive?
1 The Viewport Meta Tag <meta name="viewport" content="width=device-width, initial-scale=1">
2 Percentages in CSS .main-content { width: 67%; } .side-column
{ width: 33%; }
3 CSS Media Queries div.content { width: 1100px; margin: 0
auto; } /* Large monitors */ @media screen and (min-width: 1600px) { div.content { width: 1440px; } } ... /* Tablets in portrait */ @media screen and (min-width: 761px) and (max-width: 990px) { div.content { width: 740px; } } /* Mobile */ @media screen and (max-width: 760px) { div.content { width: 100%; } }
4 Responsiveness in JavaScript // Detect screen size // ------------------
if (window.innerWidth < 768) { // Do stuff specific to mobile } // ... or use enquire.js // --------------------- enquire.register("screen and (min-width:768px)", function() { // Load sidebar content in via AJAX. // Show sidebar });
Responsive Design Patterns
1 2 3 1 2 3
http://bradfrost.github.io/this-is-responsive/patterns.html Tons of examples
Useful Tools
Front-end Frameworks
None
Front-end Frameworks Fast and easy to get started. +
Front-end Frameworks Fast and easy to get started. + Pollutes
your HTML and can limit you. –
https://github.com/scottjehl/Respond Respond.js Makes old browsers (IE8-) support Media Queries.
Responsive Web Safari!
1. http://trentwalton.com/ 2. http://www.bostonglobe.com/ 3. https://corporate.target.com/ 4. http://css-tricks.com/ 5. http://elliotjaystocks.com/
6. http://www.leanmachine.se/ 7. http://www.awwwards.com/ 8. http://www.squarespace.com/stories 9. http://www.jessicahische.is/ 10. http://forefathersgroup.com/ 11. http://palantir.net/ 12. http://www.ampersandconf.com/
leanmachine.se ▪
[email protected]
▪ 2013-09-06
More Decks by Erik Frisk
See All by Erik Frisk
Seven UX Design Rules
erikfrisk
10
470
The Science of Design
erikfrisk
3
250
Organizing Stylesheets with CSS Pre-processors
erikfrisk
0
210
Intro to HTML5
erikfrisk
2
180
Graceful Degradation with Modernizr
erikfrisk
1
180
Customer On-boarding in Practice
erikfrisk
2
160
Other Decks in Programming
See All in Programming
Claude Codeのおかげでやりたいことがやれるようになったんだよォー!
sms_tech
0
190
ビジネスロジックを堅牢に~Scala 3のドメインプリミティブ~
j5ik2o
0
240
vue-tsc x TypeScript7
koukimiura
0
110
Datadog を OTel にするメリットを考察する — Datadog との併用を実アプリで確かめる / Examining the Benefits of Moving Datadog to OTel — Testing OTel Alongside Datadog in a Real App
seike460
PRO
1
120
ruby/uri meets WHATWG
jinroq
0
190
선언형 햅틱 라이브러리 진동을 소개합니다
l2hyunwoo
1
330
コード生成時代のAPI定義を支えるRequest Spec移行
pvcresin
0
320
Crash Auto Pipelines
veronikapj
1
460
正解の無い問題を 「できるだけ上手く」解く ヒューリスティックで感性を磨こう。〜現実課題をプログラミングで解きあうコミュニティについて〜
allegrogiken
0
120
Jujutsu で毎日のバージョン管理に「安心」と「直感性」を
oukayuka
0
130
AWS CDKを理解するために公式の定義を深掘って解説してみる / Understanding AWS CDK by Digging into Its Official Definition
akihisaikeda
3
360
RaspberryPi 5で軽くはじめるk3sとtailscaleを用いたホームサーバー構築 (1)
nasum
0
450
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
340
58k
How to make the Groovebox
asonas
2
2.6k
Well, that’s weird…
csswizardry
3
260
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Building an army of robots
kneath
307
47k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
370
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
61k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
1.1k
Abbi's Birthday
coloredviolet
5
11k
Highjacked: Video Game Concept Design
rkendrick25
PRO
2
600
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.7k
How to build a perfect <img>
jonoalderson
1
6.3k