Real solutions, no tricks

98
Real solutions, no tricks!

description

English version of a talk given at SAE Alumni Convention 2011 in Berlin, covering modern web development with HTML5 and CSS3

Transcript of Real solutions, no tricks

Page 1: Real solutions, no tricks

Real solutions, no tricks!

Page 2: Real solutions, no tricks

‣Frontend developer

‣10 years work in agencies

‣12 years work in and for the web

‣Founder of the Webkrauts

‣Blogger

‣Author for several developer-magazines

‣technical book-editor for Galileo, O'Reilly, Pearson

Jens Grochtdreis

Page 3: Real solutions, no tricks
Page 4: Real solutions, no tricks
Page 6: Real solutions, no tricks

Less documents, more applications

Page 7: Real solutions, no tricks
Page 8: Real solutions, no tricks
Page 9: Real solutions, no tricks

Missing controls

Page 10: Real solutions, no tricks
Page 11: Real solutions, no tricks

What can we do with CSS 2?

Page 12: Real solutions, no tricks

‣ text formats

‣ colours for fore- and background

‣ positioning

‣ floats

‣ images are needed for many solutions

‣ sometimes extra markup is needed for image-based solutions

‣ transparence with side effects

Page 13: Real solutions, no tricks

HTML5-Highlights

Page 14: Real solutions, no tricks

One Doctype to rule them all

<!DOCTYPE html>

Page 15: Real solutions, no tricks

Links around block elements

Page 16: Real solutions, no tricks

New semantic elements

Page 17: Real solutions, no tricks

New HTML5-Elements

http://html5doctor.com/designing-a-blog-with-html5/#comment-17535

Page 18: Real solutions, no tricks

New semantic elements

‣ On many occasions a replacement for DIV.

‣ Based on the actual practise on the web.

‣ No special functions in the browser. Just new elements.

‣WAI-ARIA inclusive!

Page 19: Real solutions, no tricks

New semantic

‣ fine structure of the content

‣ Browser takes on the headline hierarchy. On complex pages this is great! Outline-algorithm

Page 20: Real solutions, no tricks

http://html5doctor.com/

Page 21: Real solutions, no tricks

The outline-algorithm

Page 22: Real solutions, no tricks

Headlines

‣ HTML4/XHTML: 6 headlines

‣ HTML5: endless headlines

Page 23: Real solutions, no tricks
Page 24: Real solutions, no tricks

‣ Each content inside the <body>-element is part of a "section". Sections can be nested.

‣ The <body>-element is the main section. Further sections are implicitely (h1 - h6) or explicitly defined.

‣ These elemens are defining explicitely a section:

‣ <body>, <section>, <article>, <aside>, <footer>, <header>, <nav>

Page 25: Real solutions, no tricks

https://developer.mozilla.org/en/Sections_and_Outlines_of_an_HTML5_document

Each section has its own headings-hierarchy

Page 26: Real solutions, no tricks

the outline - uncertainty

from an MDN-article

http://gsnedders.html5.org/outliner/process.py

Online-Outliner-Tool

Page 27: Real solutions, no tricks

Does this threaten us?

https://github.com/cboone/hypsometric-css/blob/master/html5/html5-defaults.css#L426

Page 28: Real solutions, no tricks

Think of the consequences!

Page 29: Real solutions, no tricks

http://code.google.com/p/html5shim/

‣ HTML5-pages work in old browsers only via javascript. This concerns mainly IE including version 8.

http://www.modernizr.com/

Page 30: Real solutions, no tricks

With Javascript

Page 31: Real solutions, no tricks

Without Javascript

Page 32: Real solutions, no tricks

HTML5-formelements

Page 33: Real solutions, no tricks

HTML5-formelements

Page 34: Real solutions, no tricks

Appropriate screen keyboard

Page 35: Real solutions, no tricks

http://wufoo.com/html5/

Page 36: Real solutions, no tricks

Date

Opera 11.5

Chrome 15 dev Firefox 5

Page 37: Real solutions, no tricks

http://wufoo.com/html5/attributes/01-placeholder.html

The placeholder-attribute

Page 38: Real solutions, no tricks

What if a browser doesn‘t know the new elements?

Page 39: Real solutions, no tricks

Then all new input-elements are rendered as

<input type=“text“> and attributes get ignored.

Page 40: Real solutions, no tricks

Built-in Validation

Firefox 5 Mac

Opera 11.5 Mac

Chrome 15 dev Mac

Chrome doesn‘t play well with scaled pages and validation.

Page 41: Real solutions, no tricks

What if a browser doesn‘t know the validation?

‣ Ignore it! ( = Progressive enhancement)

‣ Load JS-alternatives with Modernizr (http://modernizr.com)

‣ Use polyfills

‣ https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills

Page 42: Real solutions, no tricks
Page 43: Real solutions, no tricks

Which gap is filled by CSS3?

Page 44: Real solutions, no tricks

animations

Less images

new layout-model

more possibilities with borders and backgrounds

new selectors

Page 45: Real solutions, no tricks

rounded corners

gradients

transitions

multiple columnscalc()

transparency with rgba()

media-queries

Page 46: Real solutions, no tricks

The pros

‣ Less decorative images are needed

‣ Less Javascript is needed.

‣ Animations and transitions via CSS are faster than via Javascript.

‣ The sourcecode will be leaner and better readable as HTML is rarely used for decorative purpose.

Page 48: Real solutions, no tricks

The cons

There are none!

Page 49: Real solutions, no tricks

Okay, a small one!

Page 50: Real solutions, no tricks

modern selectors

Page 51: Real solutions, no tricks

‣ Old IE (including version 8) don‘t understand them!

‣ Those browser can be helped via Javascript.

‣ If those selections aren‘t „vital“ the use of Javascript is okay.

Page 52: Real solutions, no tricks
Page 54: Real solutions, no tricks

Can I use CSS3 and HTML5 today?

Page 55: Real solutions, no tricks

yes and no

Page 56: Real solutions, no tricks

Some new properties aren‘t implemented in any browser.

Page 57: Real solutions, no tricks

Does this work in IE, too?

http://www.sts.tu-harburg.de/projects/WEL/0911/images/Der%20Schrei.jpg

Page 61: Real solutions, no tricks

Progress depends on the slowest because of its wide

distribution.

Page 62: Real solutions, no tricks

http://blogs.sitepointstatic.com/images/tech/121-ie6-mod-orange.jpg

Old IE-versions ...

Page 63: Real solutions, no tricks

The Web is inherently flexible

Page 64: Real solutions, no tricks

„Responsive Design“ is no new invention, despite the hype!

Page 65: Real solutions, no tricks
Page 66: Real solutions, no tricks

The consumer can use information from the Internet

as he likes.

Page 67: Real solutions, no tricks

http://mediaqueri.es/

Page 69: Real solutions, no tricks

important insight:There can not be THE ONE

form of representation!

Page 71: Real solutions, no tricks

Our Layout is only a recommendation!

Page 72: Real solutions, no tricks

Agree early on the development strategy

Page 73: Real solutions, no tricks

IE ≠ modern

http://css3generator.com/

Page 74: Real solutions, no tricks

Progressive Enhancement

http://www.alistapart.com/articles/understandingprogressiveenhancement/

‣ Focus is on the content

Page 75: Real solutions, no tricks

Graceful Degredation

‣ Focus is on the most modern browsers

‣ old browsers get a downgraded version

http://stuffandnonsense.co.uk/

Page 76: Real solutions, no tricks

Brutal Degredation

including IE8 modern browsers

http://www.fillerati.com/

Page 77: Real solutions, no tricks

http://workdiary.de/

Page 78: Real solutions, no tricks

How to deal with IE

Page 79: Real solutions, no tricks

Fallback

Page 80: Real solutions, no tricks

‣ Microsoft participates at the technical improvement of the internet starting with IE9.

‣ For most techniques it doesn‘t matter if we talk about IE6 or IE8.

‣ Some may be simulated by Javascript.

‣ Some may be simulated by IE-filters.

‣ Apart from that: graceful degredation / progressive enhancement

Page 81: Real solutions, no tricks

Even with modern techniques you can do

nonsense!

Page 82: Real solutions, no tricks

CSS3 ≠ always useful

http://codepo8.github.com/CSS3-Rainbow-Dividers/

Page 84: Real solutions, no tricks

Frameworks/Tools

Page 86: Real solutions, no tricks

http://www.modernizr.com/

Page 88: Real solutions, no tricks

http://www.css3.me/

Page 89: Real solutions, no tricks

http://www.css3maker.com/

Page 90: Real solutions, no tricks

http://css3.mikeplate.com/

Page 96: Real solutions, no tricks

The three most important best practices

Think Investigate

http://goo.gl/HbFx0http://goo.gl/NYGeI

Experiment

http://goo.gl/LohPq

Page 97: Real solutions, no tricks

Twitter: @Flocke

Slideshare: Flocke669

Page 98: Real solutions, no tricks

Jens Grochtdreishttp://grochtdreis.de

http://twitter.com/Flockehttp://webkrauts.de

http://slideshare.net/Flocke669

Diese Präsentation steht unter der Creative Commons Lizenz „Attribution-ShareAlike 2.0“ http://creativecommons.org/licenses/by-sa/2.0/de/