HTML5 CSS3
HTML5 CSS3
HTML5 CSS3
So what is HTML5?
! It is the fifth revision of HTML standard.
! Rules New features should be based on HTML, CSS, DOM, and JavaScript Reduce the need for external plugins and more markup to replace scripting Should be device independent and development process should be visible to the public
Before Start
! What is Render Engine/Web Browser Engine ! What is NAMESPACE ! What is ELEMENT/TAG
<!DOCTYPE html> <html> <head> <title>Title of the document</title> </head> <body> The content of the document...... </body> </html>
Better Forms
! New elements
! Progress, Meter, Datalist, Keygen, Output
! Input attributes
! Autofocus, placeholder, required, pattern
http://www.html5rocks.com/en/tutorials/forms/html5forms
Media Elements
Audio and video are first class citizens in the HTML5 web, living in harmony with your apps and sites. Lights, camera, action!
! Audio
http://www.w3schools.com/html/tryit.asp?filename=tryhtml_audio_all <audio controls height="100" width="100"> <source src="horse.mp3" type="audio/mpeg"> <source src="horse.ogg" type="audio/ogg"> <embed height="50" width="100" src="horse.mp3"> </audio>
! Video
http://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_video <video width="320" height="240" controls> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg"> Your browser does not support the video tag. </video>
Canvas
! draw graphics, on the fly, via scripting (usually JavaScript) ! it is only a container for graphics
Create a Canvas
<canvas id="myCanvas" width="200" height="100"></canvas>
Device Access
Beginning with the Geo location API, Web Applications can present rich, deviceaware features and experiences. Incredible device access innovations are being developed and implemented, from audio/video input access to microphones and cameras, to local data such as contacts & events, and even tilt orientation.
Device Access
! Orientation, Motion, Geo location ! Calendar ! Camera ! User Interface ( Drag and Drop, beep, vibrate, native application menu etc) ! Application Launcher ! Contacts ! Communication Log, File System, Gallery, Messaging etc
Connectivity
More efficient connectivity means more real-\me chats, faster games, and better communication. Web Sockets and Server-Sent Events are pushing data between client and server more efficiently than ever before.
Just That?
Web Workers, XMLHttpRequest 2, SVG, WebGL much more!
CSS3
What is CSS?
! CSS is used to control the style and layout of Web pages. ! Selector and Declaration Block ! Usage Inline, In page, as separate file
http://en.wikipedia.org/wiki/Cascading_Style_Sheets
CSS3
! CSS3 is the latest standard for CSS. ! Completely backwards compatible. ! Still under development by W3C and almost done. ! Many of the modern browsers have been implemented it.
CSS3 Modules
! Selectors ! Backgrounds and Borders ! Text Effects ! 2D/3D Transformations ! Animations ! Multiple Column Layout ! User Interface
Selectors
! A lot of new selectors ! http://www.w3schools.com/cssref/css_selectors.asp
CSS3 @font-face
2D Transforms
translate()
div { transform: translate(50px,100px); }
2D Transforms
rotate()
div { transform: rotate(30deg); }
2D Transforms
scale()
div { transform: scale(2,4); }
2D Transforms
skew()
div { transform: skew(30deg,20deg); }
http://localhost/~umesh/srm/css3_transitions.html
3D Transforms
rotateX() and rotateY()
div { transform: rotateX(120deg); -webkit-transform: rotateX(120deg); /* Safari and Chrome */ }
http://localhost/~umesh/srm/css3_transform.html
Animations
@keyframes
@keyframes myfirst { 0% {background: red;} 25% {background: yellow;} 50% {background: blue;} 100% {background: green;} }
animate:
div { animation: myfirst 5s; -webkit-animation: myfirst 5s; /* Safari and Chrome */ } http://localhost/~umesh/srm/css3_animations.html
Few samples
http://www.keithclark.co.uk/labs/css3-fps-new/ http://www.satine.org/research/webkit/snowleopard/snowstack.html https://developer.apple.com/safaridemos/showcase/transitions/ http://www.satine.org/research/webkit/snowleopard/snowstack.html https://developer.apple.com/safaridemos/showcase/threesixty/ http://chrome.angrybirds.com/ http://www.chromeweblab.com
A Small Hands on
http://localhost/~umesh/srm/sample/index.html
Thank You!
Umesh Ganapathy
Umesh.ganapathy@gmail.com