SlideShare a Scribd company logo
Responsive Web In Brief 
EPAM Ukraine, 2014, oleg_gomozov@epam.com
About me 
•7 years in IT 
•.NET background 
•JS and Front-End with mobile applications expertise 
•Tech trainer for EPAM JS Labs
Choose yours: flexible, fluid, adaptive, responsive
•Flexible–change size, scale 
•Fluid–flexible + grid or some layout rules 
•Adaptive–fluid + change in content, UI elements face and appearance 
•Responsive –adaptive + change of interface, behavior, interactions, device and human specifics
Some info about units
Flexible measurements 
<bodystyle=“margin: 0auto;”> 
<header>Header text 
<span>Small text</span> 
</header> 
</body> 
From pixel to em: 
target / context = result 
for “header”: 
target = 24px 
context = 16px (base font size per browser) 
result = 24px / 16px = 1.5em 
for “header” –>“span”: 
target = 14px 
context = 24px (header font size) 
result = 14px / 24px = 0.583333333em
Flexible grid-based layout
From pixel to % 
target / context = result 
for “header”: 
target = 900px (body size) 
context = 1024px (window screen size) 
result = 900px / 1024px = 87.890675%
Other unitsrem –like em, but only body is contextvw, vh–viewport width and height (in %) dw, dh –device width and height (in %)
Media Queries Magic
@media only screen and (min-device-width : 320px) and 
(max-device-width : 480px) { 
/* Styles */ 
} 
@media only screen and (min-device-width : 768px) and 
(max-device-width : 1024px) and (orientation : landscape) { 
/* Styles */ 
} 
@media only screen and (min-width : 1224px) { 
/* Styles */ 
} 
<link rel='stylesheet'media='screen and (min-width: 701px) and 
(max-width: 900px)'href='css/medium.css'/>
Media query properties 
screen 
orientation 
aspect-ratio (min, max) 
device-height (min, max) 
device-width (min, max) 
device-aspect-ratio (min, max) 
height (min, max) 
width (min, max) 
-webkit-device-pixel-ratio
JavaScript practices
Detect devices, size, specifics 
-window.navigator.userAgent 
-window.height, window.width 
-window.devicePixelRatio
varisChrome=function(){ 
returnnavigator.userAgent.indexOf(“Chrome/”) >=0; 
}; 
varisIphone=function(){ 
returnnavigator.userAgent.indexOf(“iPhone”) >=0; 
}; 
varisTablet=function(){ 
return$(window).width()>1024&& $(window).width()<2048; 
};
$(document).ready(function(){ 
if(isChrome()){ 
$('.left_menu').hide(); 
} 
if(isIphone()){ 
$('body').css('font-size','2em'); 
} 
if(isTablet()){ 
varlogo =document.getElementById('logo'); 
logo.style.backgroundImage= 'url("/images/tablet_logo.png")'; 
$('.right_menu').css('flex','1'); 
$('.left_menu').css('flex','2'); 
$('.content_menu').css('flex','4'); 
}});
matchMedia 
if(window.matchMedia("(min-width: 400px)").matches){ 
/* the view port is at least 400 pixels wide */ 
}else{ 
/* the view port is less than 400 pixels wide */ 
}
Browser, please, help me
Meta viewport and @viewport 
<metaname="viewport"content="width=device- width, initial-scale=1.0, user-scalable=false, 
minimum-scale=0.9, maximum-scale=1.1"> 
Apple-specific meta 
<metaname="apple-mobile-web-app-capable"content="yes"> 
navigator.standalonemode
Mobile first, how and why? 
Desktop is specific device, mobile is basic
Tricks, tools and hacks
http://adaptive-images.com: 
1.The HTML starts to load in the browser and a snippet of JS in the <head> writes a session cookie, storing the visitor's screen size in pixels. 
2.Browser then encounters <img> tag and sends a request to the server for that image. It also sends the browser cookie. 
3.Apache receives the request and looks in the website's .htaccessfile. 
4..htaccess: any request for JPG, GIF, or PNG file send to the adaptive- images.phpfile. 
5.PHP file looks for a cookie and finds user maximum screen size of 480px. 
6.It compares the cookie value with all $resolutionsizes that were configured, and decides which matches best. 
7.Then looks into /ai-cache/480/folder to see if a rescaled image already exists. 
8.If not the PHP then goes to the actual requested URI to find the original file. 
9.It checks image width. If that's smaller than the user's screen width it sends the image. 
10.If it's larger, the PHP creates a down-scaled copy and saves that into the /ai- cache/480/folder ready for the next time it's needed, and sends it to the user.
PictureFill 
<spandata-picture data-alt="A giant stone face"> 
<spandata-src="small.jpg"></span> 
<spandata-src="medium.jpg"data-media="(min-width: 400px)"></span> 
<spandata-src="large.jpg"data-media="(min-width: 800px)"></span> 
<spandata-src="extralarge.jpg"data-media="(min-width: 1000px)"></span> 
<spandata-src="small_x2_retina.jpg" 
data-media="(min-device-pixel-ratio: 2.0)"></span> 
<noscript><imgsrc="small.jpg"alt="A giant stone face"></noscript> 
</span> 
Filepicturefill.jsin<head>changesall<span>’swith“data-picture”attributeto<img>withcorrespondingURLfrominner<span>“data-src”attributeaccordingto“data- media”queryusingwindow.matchMedia.Alsosupportsdefferedloadingcallingwindow.picturefill()
Iconic fonts 
@font-face { 
font-family:'icons'; 
src:url('../fonts/IcoMoon.eot?#')format('eot'), 
url('../fonts/IcoMoon.woff')format('woff'), 
url('../fonts/IcoMoon.ttf')format('truetype'); 
} 
[data-icon]:before { 
font-family:icons; 
content:attr(data-icon); 
} 
<h3> 
<spandata-icon="&#x21dd;">Statistycs</span> 
</h3>
Iconic fonts benefits 
•Lossless change size, vector graphics in fonts 
•Change of solid colormask 
•Change of shape, shadow and other text transformations
HTML5 Approach 
<picture> 
<source media="(min-width: 64em)"src="high-res.jpg"> 
<source media="(min-width: 37.5em)"src="med-res.jpg"> 
<source src="low-res.jpg"><imgsrc="fallback.jpg"alt="This picture loads on non-supporting browsers."> 
<p>Accessible text.</p> 
</picture> 
picture tag
HTML5 Approach 
-web-kit-image-set 
.selector{ 
background-image:url('../img/image-1x.jpg'; 
background-image:-webkit-image-set(url('../img/image-1x.jpg') 
1x,url('../img/image-2x.jpg')2x); 
}
HTML5 Approach 
<imgsrc="fallback.jpg"srcset="small.jpg 640w 1x, 
small-hd.jpg 640w 2x, large.jpg 1x, large-hd.jpg 2x" 
alt="…"> 
srcset
Proper HTML5 input types 
<form> 
<inputtype="url"placeholder="Go to a Website"autofocus> 
<inputtype="email"required maxlength="12"> 
<inputtype="date"> 
<inputtype="datetime"> 
<inputtype="number"min="0"max="10"step="2"value="6“ 
pattern="[A-Z]{3}[0-9]{4}"> 
<inputtype="color"> 
<inputtype="submit"value="Search"> 
</form>
Pixel is not a pixel 
1 CSS Px= 1 Device Px 
CSS pixel –reference pixels, which are the main measure points for browsers measurements. 
Device pixel –physical pixels, which are the main measure points for device graphics actions. 
Zoom out 
Zoom in 
1 CSS Px= 4 Device Px, 
Retina=)
Prepare for responsive 
-componentsfunction priority 
-target devicesscreens 
-target audience and it’s context
Refs 
•Responsive Web Design, Ethan Marcotte 
•Mobile First, Luke Wroblewski 
•http://cssing.org.ua, YuriyArtyukh 
•http://dev.w3.org/csswg/css-device-adapt/#the-atviewport-rule 
•https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html 
•https://github.com/scottjehl/picturefill 
•http://adaptive-images.com 
•http://www.quirksmode.org/mobile/viewports2.html 
•http://www.quirksmode.org/blog/archives/2010/04/a_pixel_is_not.html 
•http://www.w3.org/TR/wai-aria/ 
•http://designinstruct.com/roundups/html5-frameworks/ 
•http://mashable.com/2013/04/26/css-boilerplates-frameworks/ 
•http://www.ted.com/talks/simon_sinek_how_great_leaders_inspire_action.html
The end

More Related Content

PDF
The specs behind the sex, mobile-friendly layout beyond the desktop
betabeers
 
PDF
Practical Responsive Images - from Second Wednesday
Ben Seymour
 
DOCX
Slideshare
nelsonvalentin
 
PDF
RESS – Responsive Webdesign and Server Side Components
Sven Wolfermann
 
DOC
Prova
judma
 
KEY
CSS3 Takes on the World
Jonathan Snook
 
PDF
Mobile Web Development
Jonathan Snook
 
PDF
Jamstack on Azure
Stefan Baumgartner
 
The specs behind the sex, mobile-friendly layout beyond the desktop
betabeers
 
Practical Responsive Images - from Second Wednesday
Ben Seymour
 
Slideshare
nelsonvalentin
 
RESS – Responsive Webdesign and Server Side Components
Sven Wolfermann
 
Prova
judma
 
CSS3 Takes on the World
Jonathan Snook
 
Mobile Web Development
Jonathan Snook
 
Jamstack on Azure
Stefan Baumgartner
 

What's hot (18)

PDF
Responsive Images in the Real World - presented at JavaScript Open 2015
Morten Rand-Hendriksen
 
PDF
Device aware web frameworks for better programming
Suntae Kim
 
DOC
Jager
paskar
 
PDF
Yes, browsers can do that! Hybrid and future web meetup at Jayway
Christian Heilmann
 
PDF
Once Source to Rule Them All
David Yeiser
 
PPTX
Mi pasión
pilcoedwin
 
PDF
Responsive Design: Mehr als CSS
Walter Ebert
 
TXT
Embed
Halis Demirci
 
PDF
AngularJS: The Bridge Between Today and Tomorrow's Web (Todd Motto)
Future Insights
 
PDF
Library Program Technology in Ukraine & Romania
Mark Belinsky
 
RTF
Slides pour blog
lyago
 
DOC
Teste
guestbef27f
 
PDF
Best Practices for Embedded UA - WritersUA 2012, Scott DeLoach, ClickStart
Scott DeLoach
 
PDF
High Performance Images
Walter Ebert
 
PPTX
jQuery Mobile - Desenvolvimento para dispositivos móveis
Pablo Garrido
 
PDF
Responsive and Fast
Sven Wolfermann
 
PDF
Bilder usw...
Walter Ebert
 
Responsive Images in the Real World - presented at JavaScript Open 2015
Morten Rand-Hendriksen
 
Device aware web frameworks for better programming
Suntae Kim
 
Jager
paskar
 
Yes, browsers can do that! Hybrid and future web meetup at Jayway
Christian Heilmann
 
Once Source to Rule Them All
David Yeiser
 
Mi pasión
pilcoedwin
 
Responsive Design: Mehr als CSS
Walter Ebert
 
AngularJS: The Bridge Between Today and Tomorrow's Web (Todd Motto)
Future Insights
 
Library Program Technology in Ukraine & Romania
Mark Belinsky
 
Slides pour blog
lyago
 
Best Practices for Embedded UA - WritersUA 2012, Scott DeLoach, ClickStart
Scott DeLoach
 
High Performance Images
Walter Ebert
 
jQuery Mobile - Desenvolvimento para dispositivos móveis
Pablo Garrido
 
Responsive and Fast
Sven Wolfermann
 
Bilder usw...
Walter Ebert
 
Ad

Similar to Responsive Web in Brief (20)

PDF
[convergese] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
PDF
[html5tx] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
PDF
[cssdevconf] Adaptive Images in RWD
Christopher Schmitt
 
PDF
Responsive Web Design
Abdulhadi ÇELENLİOĞLU
 
PDF
[rwdsummit2012] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
PDF
[HEWEBAR 2012] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
PDF
[refreshaustin] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
PPTX
Responsive Web Design
Julia Vi
 
PDF
Responsive Websites
Joe Seifi
 
PDF
Responsive web design
Janet Huang
 
PDF
Responsive web design
Ben MacNeill
 
PDF
Responsive websites. Toolbox
Wojtek Zając
 
PPTX
Using Responsive Web Design To Make Your Web Work Everywhere
Chris Love
 
PPTX
FITC - 2012-04-23 - Responsive Web Design
Frédéric Harper
 
PDF
Retro Responsive: From Fixed-Width to Flexible in 55 Minutes
Rachel Chartoff
 
PPTX
Using Responsive Web Design To Make Your Web Work Everywhere
Chris Love
 
PDF
Great Responsive-ability Web Design
Mike Wilcox
 
PDF
[CSSDevConf] Adaptive Images in Responsive Web Design 2014
Christopher Schmitt
 
PDF
Responsive website design
svaithiyalingam
 
PPT
Going Responsive with WordPress
James Cryer
 
[convergese] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[html5tx] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[cssdevconf] Adaptive Images in RWD
Christopher Schmitt
 
Responsive Web Design
Abdulhadi ÇELENLİOĞLU
 
[rwdsummit2012] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[HEWEBAR 2012] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
[refreshaustin] Adaptive Images in Responsive Web Design
Christopher Schmitt
 
Responsive Web Design
Julia Vi
 
Responsive Websites
Joe Seifi
 
Responsive web design
Janet Huang
 
Responsive web design
Ben MacNeill
 
Responsive websites. Toolbox
Wojtek Zając
 
Using Responsive Web Design To Make Your Web Work Everywhere
Chris Love
 
FITC - 2012-04-23 - Responsive Web Design
Frédéric Harper
 
Retro Responsive: From Fixed-Width to Flexible in 55 Minutes
Rachel Chartoff
 
Using Responsive Web Design To Make Your Web Work Everywhere
Chris Love
 
Great Responsive-ability Web Design
Mike Wilcox
 
[CSSDevConf] Adaptive Images in Responsive Web Design 2014
Christopher Schmitt
 
Responsive website design
svaithiyalingam
 
Going Responsive with WordPress
James Cryer
 
Ad

More from EPAM (9)

PDF
JavaScript. Code Quality.
EPAM
 
PDF
Continuous integration for JavaScript projects
EPAM
 
PDF
Visualization of Big Data in Web Apps
EPAM
 
PDF
Object Oriented Concepts in Real Projects
EPAM
 
PDF
Modern web applications infrastructure
EPAM
 
PPTX
Reactive Extensions: classic Observer in .NET
EPAM
 
PPTX
SOLID Principles in the real world
EPAM
 
PDF
Future of the Future of E-Commerce
EPAM
 
PDF
Bootify Yyour App from Zero to Hero
EPAM
 
JavaScript. Code Quality.
EPAM
 
Continuous integration for JavaScript projects
EPAM
 
Visualization of Big Data in Web Apps
EPAM
 
Object Oriented Concepts in Real Projects
EPAM
 
Modern web applications infrastructure
EPAM
 
Reactive Extensions: classic Observer in .NET
EPAM
 
SOLID Principles in the real world
EPAM
 
Future of the Future of E-Commerce
EPAM
 
Bootify Yyour App from Zero to Hero
EPAM
 

Recently uploaded (20)

PPTX
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
PPTX
Can You Build Dashboards Using Open Source Visualization Tool.pptx
Varsha Nayak
 
PPTX
TRAVEL APIs | WHITE LABEL TRAVEL API | TOP TRAVEL APIs
philipnathen82
 
PPTX
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
PDF
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
PDF
Summary Of Odoo 18.1 to 18.4 : The Way For Odoo 19
CandidRoot Solutions Private Limited
 
PDF
An Experience-Based Look at AI Lead Generation Pricing, Features & B2B Results
Thomas albart
 
PDF
10 posting ideas for community engagement with AI prompts
Pankaj Taneja
 
PDF
New Download FL Studio Crack Full Version [Latest 2025]
imang66g
 
PDF
Key Features to Look for in Arizona App Development Services
Net-Craft.com
 
PDF
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
PDF
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
PPT
Why Reliable Server Maintenance Service in New York is Crucial for Your Business
Sam Vohra
 
PPTX
Explanation about Structures in C language.pptx
Veeral Rathod
 
PDF
MiniTool Power Data Recovery Crack New Pre Activated Version Latest 2025
imang66g
 
PDF
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
PDF
Bandai Playdia The Book - David Glotz
BluePanther6
 
PDF
Immersive experiences: what Pharo users do!
ESUG
 
PPTX
Presentation about variables and constant.pptx
kr2589474
 
PDF
Exploring AI Agents in Process Industries
amoreira6
 
slidesgo-unlocking-the-code-the-dynamic-dance-of-variables-and-constants-2024...
kr2589474
 
Can You Build Dashboards Using Open Source Visualization Tool.pptx
Varsha Nayak
 
TRAVEL APIs | WHITE LABEL TRAVEL API | TOP TRAVEL APIs
philipnathen82
 
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
Summary Of Odoo 18.1 to 18.4 : The Way For Odoo 19
CandidRoot Solutions Private Limited
 
An Experience-Based Look at AI Lead Generation Pricing, Features & B2B Results
Thomas albart
 
10 posting ideas for community engagement with AI prompts
Pankaj Taneja
 
New Download FL Studio Crack Full Version [Latest 2025]
imang66g
 
Key Features to Look for in Arizona App Development Services
Net-Craft.com
 
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
Why Reliable Server Maintenance Service in New York is Crucial for Your Business
Sam Vohra
 
Explanation about Structures in C language.pptx
Veeral Rathod
 
MiniTool Power Data Recovery Crack New Pre Activated Version Latest 2025
imang66g
 
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
Bandai Playdia The Book - David Glotz
BluePanther6
 
Immersive experiences: what Pharo users do!
ESUG
 
Presentation about variables and constant.pptx
kr2589474
 
Exploring AI Agents in Process Industries
amoreira6
 

Responsive Web in Brief

  • 1. Responsive Web In Brief EPAM Ukraine, 2014, [email protected]
  • 2. About me •7 years in IT •.NET background •JS and Front-End with mobile applications expertise •Tech trainer for EPAM JS Labs
  • 3. Choose yours: flexible, fluid, adaptive, responsive
  • 4. •Flexible–change size, scale •Fluid–flexible + grid or some layout rules •Adaptive–fluid + change in content, UI elements face and appearance •Responsive –adaptive + change of interface, behavior, interactions, device and human specifics
  • 6. Flexible measurements <bodystyle=“margin: 0auto;”> <header>Header text <span>Small text</span> </header> </body> From pixel to em: target / context = result for “header”: target = 24px context = 16px (base font size per browser) result = 24px / 16px = 1.5em for “header” –>“span”: target = 14px context = 24px (header font size) result = 14px / 24px = 0.583333333em
  • 8. From pixel to % target / context = result for “header”: target = 900px (body size) context = 1024px (window screen size) result = 900px / 1024px = 87.890675%
  • 9. Other unitsrem –like em, but only body is contextvw, vh–viewport width and height (in %) dw, dh –device width and height (in %)
  • 11. @media only screen and (min-device-width : 320px) and (max-device-width : 480px) { /* Styles */ } @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) { /* Styles */ } @media only screen and (min-width : 1224px) { /* Styles */ } <link rel='stylesheet'media='screen and (min-width: 701px) and (max-width: 900px)'href='css/medium.css'/>
  • 12. Media query properties screen orientation aspect-ratio (min, max) device-height (min, max) device-width (min, max) device-aspect-ratio (min, max) height (min, max) width (min, max) -webkit-device-pixel-ratio
  • 14. Detect devices, size, specifics -window.navigator.userAgent -window.height, window.width -window.devicePixelRatio
  • 15. varisChrome=function(){ returnnavigator.userAgent.indexOf(“Chrome/”) >=0; }; varisIphone=function(){ returnnavigator.userAgent.indexOf(“iPhone”) >=0; }; varisTablet=function(){ return$(window).width()>1024&& $(window).width()<2048; };
  • 16. $(document).ready(function(){ if(isChrome()){ $('.left_menu').hide(); } if(isIphone()){ $('body').css('font-size','2em'); } if(isTablet()){ varlogo =document.getElementById('logo'); logo.style.backgroundImage= 'url("/images/tablet_logo.png")'; $('.right_menu').css('flex','1'); $('.left_menu').css('flex','2'); $('.content_menu').css('flex','4'); }});
  • 17. matchMedia if(window.matchMedia("(min-width: 400px)").matches){ /* the view port is at least 400 pixels wide */ }else{ /* the view port is less than 400 pixels wide */ }
  • 19. Meta viewport and @viewport <metaname="viewport"content="width=device- width, initial-scale=1.0, user-scalable=false, minimum-scale=0.9, maximum-scale=1.1"> Apple-specific meta <metaname="apple-mobile-web-app-capable"content="yes"> navigator.standalonemode
  • 20. Mobile first, how and why? Desktop is specific device, mobile is basic
  • 22. http://adaptive-images.com: 1.The HTML starts to load in the browser and a snippet of JS in the <head> writes a session cookie, storing the visitor's screen size in pixels. 2.Browser then encounters <img> tag and sends a request to the server for that image. It also sends the browser cookie. 3.Apache receives the request and looks in the website's .htaccessfile. 4..htaccess: any request for JPG, GIF, or PNG file send to the adaptive- images.phpfile. 5.PHP file looks for a cookie and finds user maximum screen size of 480px. 6.It compares the cookie value with all $resolutionsizes that were configured, and decides which matches best. 7.Then looks into /ai-cache/480/folder to see if a rescaled image already exists. 8.If not the PHP then goes to the actual requested URI to find the original file. 9.It checks image width. If that's smaller than the user's screen width it sends the image. 10.If it's larger, the PHP creates a down-scaled copy and saves that into the /ai- cache/480/folder ready for the next time it's needed, and sends it to the user.
  • 23. PictureFill <spandata-picture data-alt="A giant stone face"> <spandata-src="small.jpg"></span> <spandata-src="medium.jpg"data-media="(min-width: 400px)"></span> <spandata-src="large.jpg"data-media="(min-width: 800px)"></span> <spandata-src="extralarge.jpg"data-media="(min-width: 1000px)"></span> <spandata-src="small_x2_retina.jpg" data-media="(min-device-pixel-ratio: 2.0)"></span> <noscript><imgsrc="small.jpg"alt="A giant stone face"></noscript> </span> Filepicturefill.jsin<head>changesall<span>’swith“data-picture”attributeto<img>withcorrespondingURLfrominner<span>“data-src”attributeaccordingto“data- media”queryusingwindow.matchMedia.Alsosupportsdefferedloadingcallingwindow.picturefill()
  • 24. Iconic fonts @font-face { font-family:'icons'; src:url('../fonts/IcoMoon.eot?#')format('eot'), url('../fonts/IcoMoon.woff')format('woff'), url('../fonts/IcoMoon.ttf')format('truetype'); } [data-icon]:before { font-family:icons; content:attr(data-icon); } <h3> <spandata-icon="&#x21dd;">Statistycs</span> </h3>
  • 25. Iconic fonts benefits •Lossless change size, vector graphics in fonts •Change of solid colormask •Change of shape, shadow and other text transformations
  • 26. HTML5 Approach <picture> <source media="(min-width: 64em)"src="high-res.jpg"> <source media="(min-width: 37.5em)"src="med-res.jpg"> <source src="low-res.jpg"><imgsrc="fallback.jpg"alt="This picture loads on non-supporting browsers."> <p>Accessible text.</p> </picture> picture tag
  • 27. HTML5 Approach -web-kit-image-set .selector{ background-image:url('../img/image-1x.jpg'; background-image:-webkit-image-set(url('../img/image-1x.jpg') 1x,url('../img/image-2x.jpg')2x); }
  • 28. HTML5 Approach <imgsrc="fallback.jpg"srcset="small.jpg 640w 1x, small-hd.jpg 640w 2x, large.jpg 1x, large-hd.jpg 2x" alt="…"> srcset
  • 29. Proper HTML5 input types <form> <inputtype="url"placeholder="Go to a Website"autofocus> <inputtype="email"required maxlength="12"> <inputtype="date"> <inputtype="datetime"> <inputtype="number"min="0"max="10"step="2"value="6“ pattern="[A-Z]{3}[0-9]{4}"> <inputtype="color"> <inputtype="submit"value="Search"> </form>
  • 30. Pixel is not a pixel 1 CSS Px= 1 Device Px CSS pixel –reference pixels, which are the main measure points for browsers measurements. Device pixel –physical pixels, which are the main measure points for device graphics actions. Zoom out Zoom in 1 CSS Px= 4 Device Px, Retina=)
  • 31. Prepare for responsive -componentsfunction priority -target devicesscreens -target audience and it’s context
  • 32. Refs •Responsive Web Design, Ethan Marcotte •Mobile First, Luke Wroblewski •http://cssing.org.ua, YuriyArtyukh •http://dev.w3.org/csswg/css-device-adapt/#the-atviewport-rule •https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html •https://github.com/scottjehl/picturefill •http://adaptive-images.com •http://www.quirksmode.org/mobile/viewports2.html •http://www.quirksmode.org/blog/archives/2010/04/a_pixel_is_not.html •http://www.w3.org/TR/wai-aria/ •http://designinstruct.com/roundups/html5-frameworks/ •http://mashable.com/2013/04/26/css-boilerplates-frameworks/ •http://www.ted.com/talks/simon_sinek_how_great_leaders_inspire_action.html