Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Web Cross Device
Search
Jacopo Rabolini
May 23, 2015
Programming
0
55
Web Cross Device
Presentazione relativa al workshop tenuto alla Wired Next Fest 2015.
Jacopo Rabolini
May 23, 2015
Tweet
Share
More Decks by Jacopo Rabolini
See All by Jacopo Rabolini
A Community of Communities
kingfelix
0
34
Other Decks in Programming
See All in Programming
AIで開発はどれくらい加速したのか?AIエージェントによるコード生成を、現場の評価と研究開発の評価の両面からdeep diveしてみる
daisuketakeda
1
2.4k
Fluid Templating in TYPO3 14
s2b
0
130
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
610
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
120
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
220
Data-Centric Kaggle
isax1015
2
770
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
200
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
7.4k
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
190
Architectural Extensions
denyspoltorak
0
280
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
1.1k
Featured
See All Featured
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
79
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Joys of Absence: A Defence of Solitary Play
codingconduct
1
290
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
1
49
Utilizing Notion as your number one productivity tool
mfonobong
3
220
Exploring anti-patterns in Rails
aemeredith
2
250
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.1k
Building an army of robots
kneath
306
46k
The Pragmatic Product Professional
lauravandoore
37
7.1k
Design in an AI World
tapps
0
140
Transcript
Web Cross Device GDG Milano @ Wired Next Fest 2015
gdgmilano.org / jacoporabolini.com
“Il web è progettato per essere universale: per includere tutto
e tutti.” - Tim Berners-Lee
C’era una volta... image: http://bradfrost.com/blog/web/responsive-web-design-missing-the-point/
... sì, una volta appunto! image: http://bradfrost.com/blog/web/responsive-web-design-missing-the-point/
desktop vs mobile Marzo 2015 Desktop Mobile 10.6% 11.3 http://www.comscore.com/ita/Insights/Blog/Number-of-Mobile-Only-Internet-Users-Now-Exceeds-
Desktop-Only-in-the-U.S
Meglio prepararsi! image: http://bradfrost.com/blog/web/responsive-web-design-missing-the-point/
Di cosa parleremo 1) Layout Fluid 2) La viewport 3)
Le media query 4) Codelab
4 approcci differenti Fixed unità di misura assolute Fluid unità
di misura relative Adaptive layout specifici per device Responsive Fluid + Adaptive
Layout Fluid
px, pt ems, % Da Fixed a Fluid
Magikabula! target ÷ context il valore desiderato in pixel la
dimensione del contenitore in pixel
Da Fixed a Fluid: text <h2> Questo è un titolo
<a href=”#”>e questo un link</a> </h2> HTML
h2 { font-size: 24px; } h2 a { font-size: 18px;
} h2 { font-size: 1.5em; } /* 24px ÷ 16px */ h2 a { font-size: 0.75em; } /* 18px ÷ 24px */ CSS CSS Da Fixed a Fluid: text
<div class=”wrap”> <div class=”content”>...</div> <div class=”sidebar”>...</div> </div> HTML Da Fixed
a Fluid: width & margin
ok ma il context? Per width e margin il context
è sempre relativo all’elemento contenitore.
.wrap { width: 1024px; } .content { width: 684px; margin-right:
20px; } .wrap { width: 90%; } /* convertito in % */ .content { width: 66.8%; margin-right: 20px; } CSS CSS Da Fixed a Fluid: width & margin
.wrap { width: 1024px; } .content { width: 684px; margin-right:
20px; } .wrap { width: 90%; } .content { width: 66.8%; margin-right: 1.95%; } Da Fixed a Fluid: width & margin CSS CSS
.wrap { width: 1024px; } .sidebar { width: 320px; }
.wrap { width: 90%; } .sidebar { width: 31.25%; } CSS CSS Da Fixed a Fluid: width & margin
<div class=”content”> <p class=”box”>...</p> <p class=”box”>...</p> </div> HTML Da Fixed
a Fluid: padding
Attenzione al context! Per il padding il context è sempre
relativo all’elemento stesso.
.content { width: 684px; margin-right: 20px; } .box { width:
332px; padding: 10px; } CSS .content { width: 66.8%; margin-right: 1.95%; } .box { width: 48.54%; padding: 3.01%; } CSS Da Fixed a Fluid: padding
La viewport
La nostra area visibile viewport viewport
Pixel is not a pixel is not a pixel 1)
Pixel hardware 2) Pixel indipendenti dal dispositivo (dip) 3) Pixel CSS
ok, quali usiamo? ➔ Device pixel ratio (dpr): rapporto tra
pixel hardware e dip ➔ Initial-scale: rapporto tra dip e pixel CSS
Un po’ d’ordine, grazie! <meta name=”viewport” content=”width=device-width, initial-scale=1” > HTML
Ora si ragiona! pixel hardware = dip = pixel CSS
Le media query
Le @media rules... @media screen { /* regole per screen
*/ } CSS <link rel=”stylesheet” type=”text/css” media=”handheld” href=”handheld.css” /> HTML
...e le @media query @media screen and (min-width: 760px) {
/* regole per schermi di almeno 760px */ } CSS medium aggiungiamo condizioni la media feture
media features • width • height • min-width • min-height
• max-width • max-height • orientation • ... valore landscape o portrait
@media query, un esempio @media screen and (min-width: 320px) {
.wrap { background-color: #AA3939; } } @media screen and (min-width: 760px) { .wrap { background-color: #183F98; } } CSS
ed ecco il risultato 760px 320px
@media query, altro esempio @media screen and (min-width: 320px) {
.sidebar, .content { float: none; } } @media screen and (min-width: 760px) { .sidebar { float: left; } .content { float: right; } } CSS
layout diversi!
Tutto assieme e... Il layout fluido collega le diverse visualizzazioni
di un sito, tra un breakpoint e il successivo.
...responsive! fluid breakpoint
Cosa abbiamo visto: • Il web è universale • 4
approcci: fixed, fluid, adaptive e responsive • Target ÷ Context nei layout fluid • La viewport e i pixel • Le media query • Tutto assieme!
Domande?
Codelab :)
Gli obiettivi: 1) Esaminare il codice del sito demo 2)
Impostare il testo in unità relative (em) 3) Impostare width, margin e padding in unità relative (%) 4) Resettare la viewport 5) Identificare i breakpoint 6) Modificare il layout in corrispondenza dei breakpoint
Risorse: gdgmilano.org/wired
Restiamo in contatto! ★ Jacopo Rabolini | Web & Graphic
designer ➔ jacoporabolini.com ➔
[email protected]
➔ google.com/+jacoporabolini
Grazie!