SlideShare a Scribd company logo
Training Session 1
Programming in HTML5 with JavaScript and CSS3
References
• https://www.microsoft.com/learning/en-us/exam-70-480.aspx
• http://www.microsoft.com/web/post/get-started-using-
html5?sf1284466=1
Topics
• Structure the UI by using semantic markup, including for search
engines and screen readers (Section, Article, Nav, Header, Footer, and
Aside); create a layout container in HTML
• Programmatically add and modify HTML elements; implement media
controls; implement HTML5 canvas and SVG graphics
Terms
• semantic markup: How to Make our markup more meaningful by
adding some new HTML5 elements, It also makes it easier for people
to understand the structure of your page better by lumping related
information together with more descriptive tag names.
Example :
<div id="header">
<h1>Using HTML 5 structure elements</h1>
</div>
semantic markup
<header>
<h1>Using HTML 5 structure elements</h1>
</header>
<div id="nav">
<ul>
<li><a href="">Home</a></li>
<li><a href="">About</></li>
<li><a href="">Contact</a></li>
</ul>
</div>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
HTML Declaration
HTML4 HTML5
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
</body>
</html>
<!DOCTYPE html>
<html lang="en"
xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
</body>
</html>
The <!DOCTYPE> declaration is not an HTML tag; it is an instruction to the web browser about what
version of HTML the page is written in.
New Semantic/Structural Elements
Tag Description
<article> Defines an article in the document
<aside> Defines content aside from the page content
<bdi> Defines a part of text that might be formatted in a different direction from other text
<details> Defines additional details that the user can view or hide
<dialog> Defines a dialog box or window
<figcaption> Defines a caption for a <figure> element
<figure> Defines self-contained content, like illustrations, diagrams, photos, code listings, etc.
<footer> Defines a footer for the document or a section
HTML5 offers new elements for better document structure:
Read more about HTML5 Semantics.
<header> Defines a header for the document or a section
<main> Defines the main content of a document
<mark> Defines marked or highlighted text
<menuitem> Defines a command/menu item that the user can invoke from a popup menu
<meter> Defines a scalar measurement within a known range (a gauge)
<nav> Defines navigation links in the document
<progress> Defines the progress of a task
<rp> Defines what to show in browsers that do not support ruby annotations
<rt> Defines an explanation/pronunciation of characters (for East Asian typography)
<ruby> Defines a ruby annotation (for East Asian typography)
<section> Defines a section in the document
<summary> Defines a visible heading for a <details> element
<time> Defines a date/time
<wbr> Defines a possible line-break
Tag Description
<datalist> Defines pre-defined options for input controls
<keygen> Defines a key-pair generator field (for forms)
<output> Defines the result of a calculation
New Form Elements
New Input Types New Input Attributes
•color
•date
•datetime
•datetime-local
•email
•month
•number
•range
•search
•tel
•time
•url
•week
•autocomplete
•autofocus
•form
•formaction
•formenctype
•formmethod
•formnovalidate
•formtarget
•height and width
•list
•min and max
•multiple
•pattern (regexp)
•placeholder
•required
•step
New Input Types
Tag Description
<canvas> Defines graphic drawing using JavaScript
<svg> Defines graphic drawing using SVG
HTML5 Graphics
New Media Elements
Tag Description
<audio> Defines sound or music content
<embed> Defines containers for external applications (like plug-ins)
<source> Defines sources for <video> and <audio>
<track> Defines tracks for <video> and <audio>
<video> Defines video or movie content
How To do semantic Markup
The right image shows how the semantic elements has a
meaning in the markup structure.
Because of the semantic richness, you can probably guess
what most of these elements do. But just in case, here is
an example of a page layout using some of these elements.
Hopefully that gives you some
context. Headers and footers are pretty self-
explanatory. The nav element can be used to create a
navigation or menu bar. You can
use sections and articles to group your content. Finally,
the aside element can be used for secondary content, for
example, as a sidebar of related links.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Title</title>
<link href="css/html5reset.css"
rel="stylesheet" />
<link href="css/style.css"
rel="stylesheet" />
</head>
<body>
<header>
<hgroup>
<h1>Header in h1</h1>
<h2>Subheader in h2</h2>
</hgroup>
</header>
<nav>
<ul>
<li><a href="#">Menu Option 1</a></li>
<li><a href="#">Menu Option 2</a></li>
<li><a href="#">Menu Option 3</a></li>
</ul>
</nav>
<section>
<article>
<header>
<h1>Article #1</h1>
</header>
<section>This is the first article. This
is<mark>highlighted</mark>.
</section>
</article>
<article>
<header>
<h1>Article #2</h1>
</header>
<section>This is the second article. These articles
could be blog posts, etc.
</section>
</article>
</section>
<aside>
<section>
<h1>Links</h1>
<ul>
<li><a href="#">Link 1</a></li>
<li><a href="#">Link 2</a></li>
<li><a href="#">Link 3</a></li>
</ul>
</section>
<figure>
<img width="85" height="85"
src="http://www.windowsdevbootcamp.com/Images/JennMar.jpg"
alt="Jennifer Marsman" />
<figcaption>Jennifer Marsman</figcaption>
</figure>
</aside>
<footer>Footer - Copyright 2011</footer>
</body>
</html>
Referances
http://blogs.msdn.com/b/jennifer/archiv
e/2011/08/01/html5-part-1-semantic-
markup-and-page-layout.aspx
Programmatically add and modify HTML
elements.
Add elements on the markup:
Programmatically add and modify HTML
elements.
Remove elements
Programmatically add and modify HTML
elements.
Replace elements:
Programmatically add and modify HTML
elements.
Moving elements
Implement media controls
If you want to build up you own customized Media controls, it is possible because HTML5 dispose Media
properties, Media events you can manipulate in the DOM to control the media object and build your own
media controls.
Media properties are:
"error", "src", "currentSrc", "networkState", "preload", "buffered", "readyState", "seeking", "currentTime",
"startTime", "duration", "paused", "defaultPlaybackRate", "playbackRate", "played", "seekable", "ended",
"autoplay", "loop", "controls", "volume", "muted“
Media events are:
"loadstart", "progress", "suspend", "emptied","stalled", "play","pause", "loadedmetadata",
"loadeddata","waiting", "playing", "canplay", "canplaythrough", "seeking","seeked", "timeupdate",
"ended", "ratechange", "durationchange", "volumechange"
The following shows how to use the media events:
Implement media controls
Example on how we can
customize controls for video
element:
Implement media controls
• HTML Audio and Video DOM Reference.
http://www.w3schools.com/tags/ref_av_dom.asp
implement HTML5 canvas and SVG graphics
• <canvas> The HTML5 <canvas> tag is used to draw graphics, on the fly, via
scripting (usually JavaScript).
• <canvas> element has no drawing abilities of its own (it is only a container
for graphics) - you must use a script to actually draw the graphics.
Canvas function and Referances:
http://www.w3schools.com/tags/ref_canvas.asp
• SVG stands for Scalable Vector Graphics.
• SVG defines vector-based graphics in XML format.
SVG referances :
http://www.w3schools.com/svg/
implement HTML5 canvas and SVG graphics
Draw Rectangle using canvas
implement HTML5 canvas and SVG graphics
Create Linear Gradient with canvas
implement HTML5 canvas and SVG graphics
Draw lines in canvas
implement HTML5 canvas and SVG graphics
Draw circle using SVG
implement HTML5 canvas and SVG graphics
Draw polygon using SVG
implement HTML5 canvas and SVG graphics
Draw Gaussian blur using SVG
Thanks for your
time hope you
enjoy it .
Motasem Alsmadi

More Related Content

DOCX
Doctype netscape
PDF
HTML5, The Open Web, and what it means for you - Altran
PDF
Intro to html 5
PPT
ASP.NET 06 - Customizing Your Sites Appearance
PDF
HTML5 - Introduction
PPT
Frontend performance
PDF
Introduction to web components
PPT
Training Project Report on Search Engines
Doctype netscape
HTML5, The Open Web, and what it means for you - Altran
Intro to html 5
ASP.NET 06 - Customizing Your Sites Appearance
HTML5 - Introduction
Frontend performance
Introduction to web components
Training Project Report on Search Engines

Viewers also liked (8)

PDF
Summer Training Report
DOCX
Jyotshana upadhyay Fresher(Btech -CSE)
PDF
Summer Training report at TATA CMC
DOCX
Industrial training report
PPTX
School billing system software
DOCX
school billing system report
DOCX
A project report on training and development with reference to hal
PDF
The Great State of Design with CSS Grid Layout and Friends
Summer Training Report
Jyotshana upadhyay Fresher(Btech -CSE)
Summer Training report at TATA CMC
Industrial training report
School billing system software
school billing system report
A project report on training and development with reference to hal
The Great State of Design with CSS Grid Layout and Friends
Ad

Similar to Training HTML (20)

PDF
HTML5, just another presentation :)
PDF
HTML5 - An introduction
KEY
Html5 Brown Bag
PDF
Html5 p resentation by techmodi
PDF
A practical guide to building websites with HTML5 & CSS3
PPTX
Html,CSS & UI/UX design
PPTX
Html5 tutorial for beginners
PPTX
HTML 5 Fundamental
PPTX
HTML5 Tutorial
PPT
Getting started with html5
PPTX
Mastering HTML: The Building Blocks of the Web
PPTX
Html5
PPTX
Html5
PPT
Brief on Html5
PPTX
Html 5
PPTX
Html5 shubelal
KEY
2022 HTML5: The future is now
PPTX
HTML5, just another presentation :)
HTML5 - An introduction
Html5 Brown Bag
Html5 p resentation by techmodi
A practical guide to building websites with HTML5 & CSS3
Html,CSS & UI/UX design
Html5 tutorial for beginners
HTML 5 Fundamental
HTML5 Tutorial
Getting started with html5
Mastering HTML: The Building Blocks of the Web
Html5
Html5
Brief on Html5
Html 5
Html5 shubelal
2022 HTML5: The future is now
Ad

Training HTML

  • 1. Training Session 1 Programming in HTML5 with JavaScript and CSS3
  • 3. Topics • Structure the UI by using semantic markup, including for search engines and screen readers (Section, Article, Nav, Header, Footer, and Aside); create a layout container in HTML • Programmatically add and modify HTML elements; implement media controls; implement HTML5 canvas and SVG graphics
  • 4. Terms • semantic markup: How to Make our markup more meaningful by adding some new HTML5 elements, It also makes it easier for people to understand the structure of your page better by lumping related information together with more descriptive tag names. Example : <div id="header"> <h1>Using HTML 5 structure elements</h1> </div> semantic markup <header> <h1>Using HTML 5 structure elements</h1> </header> <div id="nav"> <ul> <li><a href="">Home</a></li> <li><a href="">About</></li> <li><a href="">Contact</a></li> </ul> </div> <nav> <ul> <li><a href="#">Home</a></li> <li><a href="#">About</a></li> <li><a href="#">Contact</a></li> </ul> </nav>
  • 5. HTML Declaration HTML4 HTML5 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1- transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> </body> </html> <!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <title></title> </head> <body> </body> </html> The <!DOCTYPE> declaration is not an HTML tag; it is an instruction to the web browser about what version of HTML the page is written in.
  • 6. New Semantic/Structural Elements Tag Description <article> Defines an article in the document <aside> Defines content aside from the page content <bdi> Defines a part of text that might be formatted in a different direction from other text <details> Defines additional details that the user can view or hide <dialog> Defines a dialog box or window <figcaption> Defines a caption for a <figure> element <figure> Defines self-contained content, like illustrations, diagrams, photos, code listings, etc. <footer> Defines a footer for the document or a section HTML5 offers new elements for better document structure: Read more about HTML5 Semantics.
  • 7. <header> Defines a header for the document or a section <main> Defines the main content of a document <mark> Defines marked or highlighted text <menuitem> Defines a command/menu item that the user can invoke from a popup menu <meter> Defines a scalar measurement within a known range (a gauge) <nav> Defines navigation links in the document <progress> Defines the progress of a task <rp> Defines what to show in browsers that do not support ruby annotations <rt> Defines an explanation/pronunciation of characters (for East Asian typography) <ruby> Defines a ruby annotation (for East Asian typography) <section> Defines a section in the document <summary> Defines a visible heading for a <details> element <time> Defines a date/time <wbr> Defines a possible line-break
  • 8. Tag Description <datalist> Defines pre-defined options for input controls <keygen> Defines a key-pair generator field (for forms) <output> Defines the result of a calculation New Form Elements
  • 9. New Input Types New Input Attributes •color •date •datetime •datetime-local •email •month •number •range •search •tel •time •url •week •autocomplete •autofocus •form •formaction •formenctype •formmethod •formnovalidate •formtarget •height and width •list •min and max •multiple •pattern (regexp) •placeholder •required •step New Input Types
  • 10. Tag Description <canvas> Defines graphic drawing using JavaScript <svg> Defines graphic drawing using SVG HTML5 Graphics New Media Elements Tag Description <audio> Defines sound or music content <embed> Defines containers for external applications (like plug-ins) <source> Defines sources for <video> and <audio> <track> Defines tracks for <video> and <audio> <video> Defines video or movie content
  • 11. How To do semantic Markup The right image shows how the semantic elements has a meaning in the markup structure. Because of the semantic richness, you can probably guess what most of these elements do. But just in case, here is an example of a page layout using some of these elements. Hopefully that gives you some context. Headers and footers are pretty self- explanatory. The nav element can be used to create a navigation or menu bar. You can use sections and articles to group your content. Finally, the aside element can be used for secondary content, for example, as a sidebar of related links.
  • 12. <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>Title</title> <link href="css/html5reset.css" rel="stylesheet" /> <link href="css/style.css" rel="stylesheet" /> </head>
  • 13. <body> <header> <hgroup> <h1>Header in h1</h1> <h2>Subheader in h2</h2> </hgroup> </header> <nav> <ul> <li><a href="#">Menu Option 1</a></li> <li><a href="#">Menu Option 2</a></li> <li><a href="#">Menu Option 3</a></li> </ul> </nav> <section> <article> <header> <h1>Article #1</h1> </header> <section>This is the first article. This is<mark>highlighted</mark>. </section> </article> <article> <header> <h1>Article #2</h1> </header> <section>This is the second article. These articles could be blog posts, etc. </section> </article>
  • 14. </section> <aside> <section> <h1>Links</h1> <ul> <li><a href="#">Link 1</a></li> <li><a href="#">Link 2</a></li> <li><a href="#">Link 3</a></li> </ul> </section> <figure> <img width="85" height="85" src="http://www.windowsdevbootcamp.com/Images/JennMar.jpg" alt="Jennifer Marsman" /> <figcaption>Jennifer Marsman</figcaption> </figure> </aside> <footer>Footer - Copyright 2011</footer> </body> </html> Referances http://blogs.msdn.com/b/jennifer/archiv e/2011/08/01/html5-part-1-semantic- markup-and-page-layout.aspx
  • 15. Programmatically add and modify HTML elements. Add elements on the markup:
  • 16. Programmatically add and modify HTML elements. Remove elements
  • 17. Programmatically add and modify HTML elements. Replace elements:
  • 18. Programmatically add and modify HTML elements. Moving elements
  • 19. Implement media controls If you want to build up you own customized Media controls, it is possible because HTML5 dispose Media properties, Media events you can manipulate in the DOM to control the media object and build your own media controls. Media properties are: "error", "src", "currentSrc", "networkState", "preload", "buffered", "readyState", "seeking", "currentTime", "startTime", "duration", "paused", "defaultPlaybackRate", "playbackRate", "played", "seekable", "ended", "autoplay", "loop", "controls", "volume", "muted“ Media events are: "loadstart", "progress", "suspend", "emptied","stalled", "play","pause", "loadedmetadata", "loadeddata","waiting", "playing", "canplay", "canplaythrough", "seeking","seeked", "timeupdate", "ended", "ratechange", "durationchange", "volumechange"
  • 20. The following shows how to use the media events:
  • 21. Implement media controls Example on how we can customize controls for video element:
  • 22. Implement media controls • HTML Audio and Video DOM Reference. http://www.w3schools.com/tags/ref_av_dom.asp
  • 23. implement HTML5 canvas and SVG graphics • <canvas> The HTML5 <canvas> tag is used to draw graphics, on the fly, via scripting (usually JavaScript). • <canvas> element has no drawing abilities of its own (it is only a container for graphics) - you must use a script to actually draw the graphics. Canvas function and Referances: http://www.w3schools.com/tags/ref_canvas.asp • SVG stands for Scalable Vector Graphics. • SVG defines vector-based graphics in XML format. SVG referances : http://www.w3schools.com/svg/
  • 24. implement HTML5 canvas and SVG graphics Draw Rectangle using canvas
  • 25. implement HTML5 canvas and SVG graphics Create Linear Gradient with canvas
  • 26. implement HTML5 canvas and SVG graphics Draw lines in canvas
  • 27. implement HTML5 canvas and SVG graphics Draw circle using SVG
  • 28. implement HTML5 canvas and SVG graphics Draw polygon using SVG
  • 29. implement HTML5 canvas and SVG graphics Draw Gaussian blur using SVG
  • 30. Thanks for your time hope you enjoy it . Motasem Alsmadi