Presentation - Html5 and CSS3
Presentation - Html5 and CSS3
Agenda
HTML5 Crash course(20min)
CSS3 Crash course(10min)
Responsive Design(10 min)
Problem definition
Current Solution
Proposed Solution
How can Responsive Design help!
Logistics
This presentation is Part 1 of HTML/CSS Workshop at
TechForum, Intuit, Feb 21, 2012
This presentation at Brainstorm:
https://intuit.intuitbrainstorm.com/Idea.aspx?id=1139
8
Q&A, at the end
Post questions to
http://tiles.intuit.com/tiles/site/tile/HTML5#
HTML5 Features
New Doctype
Semantic Tags
Forms, new input types
Video, Audio
Canvas
Web Storage
Offline
Web Workers
GeoLocation
Drag and drop
Many cool features to explore
<!DOCTYPE html>
<header>
<hgroup>
<article>
<section>
<aside>
<footer>
<nav>
Benefit:
Human readable
HTML pages.
HTML4
CSS:
CSS:
#.header{}
header{}
#.navigator{}
nav {}
#.sidebar{}
aside{}
Semantic
8
<input
<input
<input
<input
<input
<input
<input
<input
<input
<input
<input
type=email>
type=url>
type=date>
type=time>
type=datetime>
type=month>
type=week>
type=number>
type=tel>
type=color>
pattern=[0-9][A-Z]{3}>
<input type=
>
Benefit:
Built in
validation.
<ul contenteditable=true>
<li>First</li>
</ul>
Benefit:
Flash killer?
<video>
11
<audio>
HTML5, Canvas
Benefit:
2D Games!
<canvas></canvas>
Dynamic rendering of 2D
shapes and bitmap images.
<canvas>
12
HTML5, Canvas
<canvas id=ex width=200 height=200>
13
Benefit:
Cookies on
steroids
Benefit:
Database in
Browser!
var db;
if(window.openDatabase){
db = openDatabase(myDB, 1.0, test db, 2 *1024 *1024);
db.transaction(function (tx) {
tx.executeSql(CREATE TABLE IF NOT EXISTS test(id, date,
testdata),[], function(){
)};//executeSql
)};//db.transaction
}
SQL syntax
15
HTML5, Offline
Offline
Application works even after network connectivity is
lost.
Manifest file needs to know what to cache.
<html manifest=/time.manifest>
Apache mimes.types:
text/cache-manifest manifest
No network, no problem
16
//In myworker.js:
onmessage = function(event){
if(event.data == hello){
postMessage(hello main)
}else{
postMessage(Busy right now!);
}
}
multi threading
17
Benefit:
Responsive
pages
HTML5, Geolocation
.Found You!
if(navigator.geolocation){
navigator.geolocation.getCurrentPosition(function(position){
var coord = position.coords;
showMap(coords.latitude, coords.longitude, coords.accuracy);
});
}
.watchPosition();
.clearPosition();
geolocation
18
CSS3
CSS3 offers a huge variety of new ways to create an
impact with your designs.
CSS 3 too has made its mark with its many features not
only augment the aesthetic appeal but also improve
functionality.
Style your HTML markup using drop shadows, rounded
corners, multiple backgrounds, animation,
transparency.
http://css3test.com/
http://www.css3.info/preview/
19
CSS3
Borders
border-radius
box-shadow
Background
background-size
background-origin
Text Wrap
text-shadow
text-wrap
@Font-face
Transforms
transform
rotateX() rotateY()
20
CSS3
Transitions
Animations
User Interface
resize
Color
opacity
Ruby
21
Responsive Design
http://www.readwriteweb.com/archives/redux_how_the_boston_gl
obe_pulled_off_html5_responsive_d.php
22
Problem Definition
Mobile phones have different widths
Use Case
Mobile Browsers with different form factor request mobile
page
On Mobile Web server, User Agent is found
DRS finds width of phone based on User Agent
One of many style sheets is chosen(different widths,
Blackberry)
Mobile page is styled
Mobile Page presented to end user.
Optimal?
Multiple style sheets, more processing, multiple images,
Current Solution,
Https Request
DRS Server
Mobile web page
176
css
240
css
320
css
480
css
320
css
Black
berry
DRS(http://tiles.intuit.com/tiles/site/tile/DRS)
24
25
Proposed Solution
Use Case
Mobile Browsers, with different widths, request mobile
page
Flexible Mobile Page presented to end user.
How?
HTML5
CSS3
Responsive Design
JQuery Mobile
26
Proposed Solution,
Responsive Design
Https Request
Responsive css
Responsive Design
27
Flexible Images
Media Queries (CSS3)
font-size=1.25em; width=80%,
margin=5%,;padding 5%;
28
max-width=100%; overflow:hidden;
29
Summary
31
References
http://www.html5rocks.com/en/
http://html5boilerplate.com/
http://diveintohtml5.info/
http://caniuse.com/
http://net.tutsplus.com/tutorials/html-csstechniques/25-html5-features-tips-and-techniquesyou-must-know/
http://jsbin.com/
http://html5demos.com/
32
Q&A
33