21
Responsive Web Design Gottfried Ryser CGX AG

OpenCms Days 2012 - Responsive design for all kind of devices

Embed Size (px)

DESCRIPTION

Does it make sense to have a website where the URL starts with "mobile"? And use a simple design for it? The web is no more just a screen with a certain resolution. Today and in the near future it can be a tablet or a smartphone. The mobile market is growing fast and forecasts say it will overtake the PC screens and Notebooks in 2013. With templates written in HTML5 and CSS3 the content of a website can be adapted to all the different screen resolutions in the best way. The content will be adjusted depending on the viewport size. So it can be seen without zooming and scrolling in a perfect format. This presentation will give an overview with samples and practical hints.

Citation preview

Page 1: OpenCms Days 2012 - Responsive design for all kind of devices

Responsive Web Design

Gottfried Ryser CGX AG

Page 2: OpenCms Days 2012 - Responsive design for all kind of devices

What is Responsive WebDesign?

The future is no more just desktop, different platforms,browsers und Responsive Design is a shift to be more open andindepend with the design.

Page 3: OpenCms Days 2012 - Responsive design for all kind of devices

The Internetmoves towards mobile devices

The time is gone for single device designBy 2014 the Mobile Internet passes the use of desktop based Internet

Page 4: OpenCms Days 2012 - Responsive design for all kind of devices

Adaptive or Responsive

Responsive is Multiple Fluid Grid Layouts

Adaptive is multiple fixed width layouts

Page 5: OpenCms Days 2012 - Responsive design for all kind of devices

Ethan Marcotte showed the wayBeginning of 2011 his book came out

Page 6: OpenCms Days 2012 - Responsive design for all kind of devices

Adapted to device specsSmall + Medium + Large - with one design

Page 7: OpenCms Days 2012 - Responsive design for all kind of devices

Adapted to devices means:

• Use in the best way the device specificfeatures

• Not just scaled down websites• Navigation with fingers - bigger

menues• No mouse over in mobiles

Page 8: OpenCms Days 2012 - Responsive design for all kind of devices

Desktop Screen

• Multiple columns• Bold design• Big pictures• Mega-menus• Columns with fixed

widths

Page 9: OpenCms Days 2012 - Responsive design for all kind of devices

Tablets Smaller screens, but also

with high resolution (AppleRetina display)

Portrait – Landscapeselectable and designadaptable

Less columns Text scaled Smaller and less pictures Navigation behavior, bigger

menus for fingers No mouse overs

Page 10: OpenCms Days 2012 - Responsive design for all kind of devices

Smartphones• Content in one column• Navigation from OS or from

script• Remove not needed

pictures• Smaller text• Even new devices use

resolution until 1280 x 800scaling does not work

Page 11: OpenCms Days 2012 - Responsive design for all kind of devices

Smartphones - Navigation

This sample shows clearly the differencebetween desktop and mobile:No picture/slider and a popup menu

Page 12: OpenCms Days 2012 - Responsive design for all kind of devices

But is responsive the only way?No, not at all - depends on design and use For eCommerce application it does not work Same with magazine style websites Navigation mixed main vertical, subnav horizontal, see the

two pages belowhttp://t.staples.com http://secondstory.com

Page 13: OpenCms Days 2012 - Responsive design for all kind of devices

What is the key?

• HTML5 / CSS3• Fluid grid• Fluid images - make images scalable• Media queries

Works best on newer browser. To adapt adesign to older ones like IE 6-7 means itdoubles the time to develop the code.

Page 14: OpenCms Days 2012 - Responsive design for all kind of devices

Fluid grid

Adaptive is multiple fixedwidth layouts

Adaptive ismultiple fixedwidth layouts

Header

Footer

Header

Footer

NavigationNavigation

ContentContent

Sidebar

SidebarOn smaller devices, stack elementsinstead of float wherever necessary

Page 15: OpenCms Days 2012 - Responsive design for all kind of devices

Media queriesUse in the headersection:<meta name="viewport" content="width=device-width, initial-scale=1.0"><link href="assets/css/bootstrap-responsive.css" rel="stylesheet">

@media screen and (min-width: 1001px) and (max-width: 1080px) {#navigation ul li a { font-size: 1.4em; }

@media screen and (min-width: 805px) and (max-width: 1000px) {#navigation ul li a { font-size: 1.25em; }

@media screen and (min-width: 769px) and (max-width: 804px) {#navigation ul li a { font-size: 1.1em; }

/* Portrait tablet to landscape and desktop */@media (min-width: 768px) and (max-width: 979px) { ... }

You can specify device specific parameters for a group of devices

Page 16: OpenCms Days 2012 - Responsive design for all kind of devices

Simple sample for testingTry this vey simple sample, add thesecode at the end of a css file

body {background-color: grey;

}@media screen and (max-width: 960px) {

body {background-color: red;

}}@media screen and (max-width: 768px) {

body {background-color: orange;

}}@media screen and (max-width: 550px) {

body {background-color: yellow;

}}@media screen and (max-width: 320px) {

body {background-color: green;

}}

Page 17: OpenCms Days 2012 - Responsive design for all kind of devices

FrameworksUse of Frameworks saves timeor your own code gives more flexibility

Our favorite is Bootstrap, goodcommunity, flexible, configurableand updated frequently.

Page 18: OpenCms Days 2012 - Responsive design for all kind of devices

Where you can learn more?

Ethan Marcotte AuthorAmazon.com

Ben Frain, AuthorPacktpub.com

Some good samples herehttp://designmodo.com/twitter-bootstrap-snippets-examples/

Page 19: OpenCms Days 2012 - Responsive design for all kind of devices

A few info’s about CGX AG

• Working with OpenCms since early days,company founded 1987, 10 employees

• Developing website based on OpenCms,eCommerce applications, productconfigurators and customer supportapplications

• Integrating OpenCms – eCommerce –SAP with SSO

• Website www.cgx.ch E-Mail [email protected]

Page 20: OpenCms Days 2012 - Responsive design for all kind of devices

Some samples of our workFibre optic network calculator

eCommerce with CMS, Flash, dataMashup

Web, Intranet, Extranet, Contract-Generator,

Page 21: OpenCms Days 2012 - Responsive design for all kind of devices

Questions?