SlideShare une entreprise Scribd logo
1  sur  30
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

Contenu connexe

En vedette

Summer Training Report
Summer Training ReportSummer Training Report
Summer Training ReportSavigya Singh
 
Jyotshana upadhyay Fresher(Btech -CSE)
Jyotshana upadhyay Fresher(Btech -CSE)Jyotshana upadhyay Fresher(Btech -CSE)
Jyotshana upadhyay Fresher(Btech -CSE)Radha Rani
 
Summer Training report at TATA CMC
Summer Training report at TATA CMCSummer Training report at TATA CMC
Summer Training report at TATA CMCPallavi Srivastava
 
Industrial training report
Industrial training reportIndustrial training report
Industrial training reportAnurag Gautam
 
School billing system software
School billing system softwareSchool billing system software
School billing system softwareaki_shu
 
school billing system report
school billing system reportschool billing system report
school billing system reportaki_shu
 
A project report on training and development with reference to hal
A project report on training and development with reference to halA project report on training and development with reference to hal
A project report on training and development with reference to halProjects Kart
 
The Great State of Design with CSS Grid Layout and Friends
The Great State of Design with CSS Grid Layout and FriendsThe Great State of Design with CSS Grid Layout and Friends
The Great State of Design with CSS Grid Layout and FriendsStacy Kvernmo
 

En vedette (8)

Summer Training Report
Summer Training ReportSummer Training Report
Summer Training Report
 
Jyotshana upadhyay Fresher(Btech -CSE)
Jyotshana upadhyay Fresher(Btech -CSE)Jyotshana upadhyay Fresher(Btech -CSE)
Jyotshana upadhyay Fresher(Btech -CSE)
 
Summer Training report at TATA CMC
Summer Training report at TATA CMCSummer Training report at TATA CMC
Summer Training report at TATA CMC
 
Industrial training report
Industrial training reportIndustrial training report
Industrial training report
 
School billing system software
School billing system softwareSchool billing system software
School billing system software
 
school billing system report
school billing system reportschool billing system report
school billing system report
 
A project report on training and development with reference to hal
A project report on training and development with reference to halA project report on training and development with reference to hal
A project report on training and development with reference to hal
 
The Great State of Design with CSS Grid Layout and Friends
The Great State of Design with CSS Grid Layout and FriendsThe Great State of Design with CSS Grid Layout and Friends
The Great State of Design with CSS Grid Layout and Friends
 

Similaire à Training HTML

Html5 tutorial
Html5 tutorialHtml5 tutorial
Html5 tutorialmadhavforu
 
Getting started with html5
Getting started with html5Getting started with html5
Getting started with html5Suresh Kumar
 
Front end full stack development module 1pptx
Front end full stack development module 1pptxFront end full stack development module 1pptx
Front end full stack development module 1pptxMaruthiPrasad96
 
Html5, a gentle introduction
Html5, a gentle introduction Html5, a gentle introduction
Html5, a gentle introduction Diego Scataglini
 
Html 5, a gentle introduction
Html 5, a gentle introductionHtml 5, a gentle introduction
Html 5, a gentle introductionDiego Scataglini
 
Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvZahouAmel1
 
HTML5 Essential Training
HTML5 Essential TrainingHTML5 Essential Training
HTML5 Essential TrainingKaloyan Kosev
 
Web design and Development
Web design and DevelopmentWeb design and Development
Web design and DevelopmentShagor Ahmed
 
Presentation about html5 css3
Presentation about html5 css3Presentation about html5 css3
Presentation about html5 css3Gopi A
 
HTML - hypertext markup language
HTML - hypertext markup languageHTML - hypertext markup language
HTML - hypertext markup languageBasmaa Mostafa
 
Web Development Course - HTML5 & CSS3 by RSOLUTIONS
Web Development Course - HTML5 & CSS3 by RSOLUTIONSWeb Development Course - HTML5 & CSS3 by RSOLUTIONS
Web Development Course - HTML5 & CSS3 by RSOLUTIONSRSolutions
 

Similaire à Training HTML (20)

Html5 tutorial
Html5 tutorialHtml5 tutorial
Html5 tutorial
 
Getting started with html5
Getting started with html5Getting started with html5
Getting started with html5
 
HTML5 Refresher
HTML5 RefresherHTML5 Refresher
HTML5 Refresher
 
Front end full stack development module 1pptx
Front end full stack development module 1pptxFront end full stack development module 1pptx
Front end full stack development module 1pptx
 
Uta005 lecture2
Uta005 lecture2Uta005 lecture2
Uta005 lecture2
 
Html5, a gentle introduction
Html5, a gentle introduction Html5, a gentle introduction
Html5, a gentle introduction
 
Html 5, a gentle introduction
Html 5, a gentle introductionHtml 5, a gentle introduction
Html 5, a gentle introduction
 
Web technologies part-2
Web technologies part-2Web technologies part-2
Web technologies part-2
 
Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
 
HTML5 Essential Training
HTML5 Essential TrainingHTML5 Essential Training
HTML5 Essential Training
 
Web design and Development
Web design and DevelopmentWeb design and Development
Web design and Development
 
Html5 css3
Html5 css3Html5 css3
Html5 css3
 
Presentation about html5 css3
Presentation about html5 css3Presentation about html5 css3
Presentation about html5 css3
 
HTML - hypertext markup language
HTML - hypertext markup languageHTML - hypertext markup language
HTML - hypertext markup language
 
Html5
Html5Html5
Html5
 
Web Development Course - HTML5 & CSS3 by RSOLUTIONS
Web Development Course - HTML5 & CSS3 by RSOLUTIONSWeb Development Course - HTML5 & CSS3 by RSOLUTIONS
Web Development Course - HTML5 & CSS3 by RSOLUTIONS
 
HTML5 Semantics
HTML5 SemanticsHTML5 Semantics
HTML5 Semantics
 
41915024 html-5
41915024 html-541915024 html-5
41915024 html-5
 
Html 5
Html 5Html 5
Html 5
 
Html5
Html5Html5
Html5
 

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