SlideShare a Scribd company logo
1 of 26
Download to read offline
html 5
What’s new ?
HTML5 is the newest hyper text
markup language for websites from
the World Wide Web Consortium
(W3C).
The successor of HTML 4.01
5th
revision of the HTML
The first draft was made public in
2008
Finalized, and published, on 28
October 2014
2
The new markup language was developed based on pre-set
standards:
★ New features should be based on HTML, CSS, DOM, and JavaScript.
★ The need for external plugins (like Flash) needs to be reduced.
★ Error handling should be easier than in previous versions.
★ Scripting has to be replaced by more markup.
★ HTML5 should be device-independent.
★ The development process should be visible to the public.
3
4
Removed Elements
<acronym> <abbr>
<applet>
<object>
<dir> <ul>
<basefont>
<big> CSS
<center>
Redefined Elements
● New Semantics
● Simplified Syntax
● Character encoding
● Optional type
attributes
● Optional solidus
(/>)
New Elements
● Sectioning Elements
● Inline Elements
● Interactive Elements
} 5
The following HTML 4 elements have been removed from
HTML5:
<acronym> <applet> <basefont>
<big> <center> <dir>
<frameset> <noframes> <strike>
<tt> <font> <frame>
6
New Doctype
<!DOCTYPE html PUBLIC "-//W3C//DTD
XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd">
7
<!DOCTYPE html>
Character encoding
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8">
8
<meta charset="utf-8">
The Figure Element
<img src="path/to/image" alt="About
image" />
<p>Image of Mars. </p>
9
<figure>
<img src="path/to/image" alt="About
image" />
<figcaption>
<p>This is an image of something
interesting. </p>
</figcaption>
</figure>
Form Handling...
● Input Types
○ Email input
○ datetime
○ Color
○ URL
○ Sliders with the Range Input
● Input Attributes
○ Placeholder
○ Required Attribute
○ Autofocus Attribute
● Regular Expressions
10
● New Form Elements
<datalist> pre-defined options for
input controls
<keygen> key-pair generator field
<output> result of a calculation
11
New Semantic Elements in HTML5
12
HTML5 adds a number of
new semantic HTML tags to
give a better definition to the
various parts (elements) that
form the structure of a
webpage.
13
<header>
<h1>Header</h1>
</header>
<nav> … </nav>
<section>
<article>
<header>
<h1>Article #1</h1>
</header>
</article>
</section>
New Features
14
Canvas
● The HTML <canvas> element is used to draw graphics, on
the fly, via scripting (usually JavaScript).
● The <canvas> element is only a container for graphics. You
must use a script to actually draw the graphics.
● Canvas has several methods for drawing paths, boxes, circles,
text, and adding images.
15
HTML5 Graphics
<audio> Sound or music content
<embed> Containers for external applications (plug-ins)
<source> Sources for <video> and <audio>
<track> Tracks for <video> and <audio>
<video> Video or movie content
16
<embed> Containers for external applications
(plug-ins)
<embed type="video/quicktime" src="movie.mov"
width="640" height="480">
17
<audio>
<audio src="audio.ogg"
controls autoplay loop>
<p>Your browser does not
support the <code>audio</code>
element </p>
</audio>
18
● controls : Displays the standard
HTML5 controls for the audio on
the web page.
● autoplay : Makes the audio play
automatically.
● loop : Make the audio repeat
(loop) automatically.
<video>
<video src="http://v2v.cc/~j/theora_testsuite/320x240.ogg"
controls>
Your browser does not support the <code>video</code> element.
</video>
19
HTML5 Local Storage
Web applications can store data locally within the user's browser;
instead of cookies, included in every server request.
More secure
Large amounts of data can be stored locally (~ 5MB)
Information is never transferred to the server.
20
window.localStorage
● Stores data with no expiration
date
● It is per origin
(per domain and protocol)
All pages, from one origin, can
store and access the same data.
21
window.sessionStorage
● Stores data for one session
(data is lost when the browser
tab is closed)
<div id="result"></div>
<script>
// Check browser support
if (typeof(Storage) !== "undefined") {
// Store
localStorage.setItem("lastname", "Smith");
// Retrieve
document.getElementById("result").innerHTML = localStorage.getItem("lastname");
} else {
document.getElementById("result").innerHTML = "Sorry, your browser does not
support Web Storage...";
}
</script>
22
HTML5 Style Guide and Coding Conventions (1)
★ Use Correct Document Type
★ Use Lower Case
○ Element Names
○ Attribute Names
○ File Names
★ Close All HTML Elements < tag > … </tag>
★ Close Empty HTML Elements < tag />
23
HTML5 Style Guide and Coding Conventions (2)
★ Quote Attribute Values
○ <table class="table striped">
★ Image Attributes - alt, size
★ Do not omit <html> and <body>
★ Metadata - Language and the character encoding should be defined as
early as possible in a document
24
HTML5 Style Guide and Coding Conventions (3)
★ Avoid Long Code Lines
★ Blank Lines and Indentation
○ Blank lines to separate large or logical code blocks.
○ Add 2 spaces of indentation. Do not use TAB.
★ Style Sheets
○ Use simple syntax (the type attribute is not necessary)
○ Short rules can be written compressed, on one line.
○ Long rules should be written over multiple lines 25
Thank You =)
26

More Related Content

What's hot

What's hot (10)

.Net template solution architecture
.Net template solution architecture.Net template solution architecture
.Net template solution architecture
 
Html5-Web-Storage
Html5-Web-StorageHtml5-Web-Storage
Html5-Web-Storage
 
Performance (browser)
Performance (browser)Performance (browser)
Performance (browser)
 
Asp db
Asp dbAsp db
Asp db
 
Chapter 9 Getting Started with JavaScript
Chapter 9 Getting Started with JavaScriptChapter 9 Getting Started with JavaScript
Chapter 9 Getting Started with JavaScript
 
Overview to Data Transaction Management
Overview to Data Transaction ManagementOverview to Data Transaction Management
Overview to Data Transaction Management
 
Consuming Open Data using DataJS - jsFoo
Consuming Open Data using DataJS - jsFoo Consuming Open Data using DataJS - jsFoo
Consuming Open Data using DataJS - jsFoo
 
Domain-Driven Data at the O'Reilly Software Architecture Conference
Domain-Driven Data at the O'Reilly Software Architecture ConferenceDomain-Driven Data at the O'Reilly Software Architecture Conference
Domain-Driven Data at the O'Reilly Software Architecture Conference
 
The secret sauce behind {binding} in xaml
The secret sauce behind {binding} in xamlThe secret sauce behind {binding} in xaml
The secret sauce behind {binding} in xaml
 
Ng init | EPI Sousse
Ng init | EPI SousseNg init | EPI Sousse
Ng init | EPI Sousse
 

Similar to Html 5 - What's new?

Html5 tutorial
Html5 tutorialHtml5 tutorial
Html5 tutorial
madhavforu
 

Similar to Html 5 - What's new? (20)

Html5
Html5Html5
Html5
 
Dive into HTML5
Dive into HTML5Dive into HTML5
Dive into 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
 
Delhi student's day
Delhi student's dayDelhi student's day
Delhi student's day
 
Html5 ppt
Html5 pptHtml5 ppt
Html5 ppt
 
Html5
Html5Html5
Html5
 
php
phpphp
php
 
Html5 introduction
Html5 introductionHtml5 introduction
Html5 introduction
 
Html5 Basics
Html5 BasicsHtml5 Basics
Html5 Basics
 
Html,CSS & UI/UX design
Html,CSS & UI/UX designHtml,CSS & UI/UX design
Html,CSS & UI/UX design
 
HTML5_3.ppt
HTML5_3.pptHTML5_3.ppt
HTML5_3.ppt
 
HTML literals, the JSX of the platform
HTML literals, the JSX of the platformHTML literals, the JSX of the platform
HTML literals, the JSX of the platform
 
Html5 tutorial
Html5 tutorialHtml5 tutorial
Html5 tutorial
 
Html5
Html5Html5
Html5
 
Html 5
Html 5Html 5
Html 5
 
HTML 5
HTML 5HTML 5
HTML 5
 
Html5
Html5Html5
Html5
 
HTML Basics by software development company india
HTML Basics by software development company indiaHTML Basics by software development company india
HTML Basics by software development company india
 
HTML5 Refresher
HTML5 RefresherHTML5 Refresher
HTML5 Refresher
 
Html5
Html5Html5
Html5
 

More from Bethmi Gunasekara

More from Bethmi Gunasekara (6)

Electron JS | Build cross-platform desktop applications with web technologies
Electron JS | Build cross-platform desktop applications with web technologiesElectron JS | Build cross-platform desktop applications with web technologies
Electron JS | Build cross-platform desktop applications with web technologies
 
General Framework for Sentiment Analysis of Twitter Data, with Special Attent...
General Framework for Sentiment Analysis of Twitter Data, with Special Attent...General Framework for Sentiment Analysis of Twitter Data, with Special Attent...
General Framework for Sentiment Analysis of Twitter Data, with Special Attent...
 
Introduction to React JS
Introduction to React JSIntroduction to React JS
Introduction to React JS
 
TestNG - The Next Generation of Unit Testing
TestNG - The Next Generation of Unit TestingTestNG - The Next Generation of Unit Testing
TestNG - The Next Generation of Unit Testing
 
No SQL- The Future Of Data Storage
No SQL- The Future Of Data StorageNo SQL- The Future Of Data Storage
No SQL- The Future Of Data Storage
 
Web Portal for Construction Industry
Web Portal for Construction IndustryWeb Portal for Construction Industry
Web Portal for Construction Industry
 

Recently uploaded

VVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts Service
VVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts ServiceVVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts Service
VVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts Service
aroranaina404
 
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard ...
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard  ...Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard  ...
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard ...
nirzagarg
 
Peaches App development presentation deck
Peaches App development presentation deckPeaches App development presentation deck
Peaches App development presentation deck
tbatkhuu1
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
amitlee9823
 
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
nirzagarg
 
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
amitlee9823
 
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
kumaririma588
 
infant assessment fdbbdbdddinal ppt.pptx
infant assessment fdbbdbdddinal ppt.pptxinfant assessment fdbbdbdddinal ppt.pptx
infant assessment fdbbdbdddinal ppt.pptx
suhanimunjal27
 

Recently uploaded (20)

VVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts Service
VVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts ServiceVVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts Service
VVIP CALL GIRLS Lucknow 💓 Lucknow < Renuka Sharma > 7877925207 Escorts Service
 
Sweety Planet Packaging Design Process Book.pptx
Sweety Planet Packaging Design Process Book.pptxSweety Planet Packaging Design Process Book.pptx
Sweety Planet Packaging Design Process Book.pptx
 
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard ...
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard  ...Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard  ...
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard ...
 
Peaches App development presentation deck
Peaches App development presentation deckPeaches App development presentation deck
Peaches App development presentation deck
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
HiFi Call Girl Service Delhi Phone ☞ 9899900591 ☜ Escorts Service at along wi...
HiFi Call Girl Service Delhi Phone ☞ 9899900591 ☜ Escorts Service at along wi...HiFi Call Girl Service Delhi Phone ☞ 9899900591 ☜ Escorts Service at along wi...
HiFi Call Girl Service Delhi Phone ☞ 9899900591 ☜ Escorts Service at along wi...
 
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
 
Q4-W4-SCIENCE-5 power point presentation
Q4-W4-SCIENCE-5 power point presentationQ4-W4-SCIENCE-5 power point presentation
Q4-W4-SCIENCE-5 power point presentation
 
Top Rated Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...
Top Rated  Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...Top Rated  Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...
Top Rated Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...
 
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
 
UI:UX Design and Empowerment Strategies for Underprivileged Transgender Indiv...
UI:UX Design and Empowerment Strategies for Underprivileged Transgender Indiv...UI:UX Design and Empowerment Strategies for Underprivileged Transgender Indiv...
UI:UX Design and Empowerment Strategies for Underprivileged Transgender Indiv...
 
❤Personal Whatsapp Number 8617697112 Samba Call Girls 💦✅.
❤Personal Whatsapp Number 8617697112 Samba Call Girls 💦✅.❤Personal Whatsapp Number 8617697112 Samba Call Girls 💦✅.
❤Personal Whatsapp Number 8617697112 Samba Call Girls 💦✅.
 
8377087607, Door Step Call Girls In Kalkaji (Locanto) 24/7 Available
8377087607, Door Step Call Girls In Kalkaji (Locanto) 24/7 Available8377087607, Door Step Call Girls In Kalkaji (Locanto) 24/7 Available
8377087607, Door Step Call Girls In Kalkaji (Locanto) 24/7 Available
 
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Brookefield Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...
 
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
 
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
infant assessment fdbbdbdddinal ppt.pptx
infant assessment fdbbdbdddinal ppt.pptxinfant assessment fdbbdbdddinal ppt.pptx
infant assessment fdbbdbdddinal ppt.pptx
 
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Saswad ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
 

Html 5 - What's new?

  • 2. HTML5 is the newest hyper text markup language for websites from the World Wide Web Consortium (W3C). The successor of HTML 4.01 5th revision of the HTML The first draft was made public in 2008 Finalized, and published, on 28 October 2014 2
  • 3. The new markup language was developed based on pre-set standards: ★ New features should be based on HTML, CSS, DOM, and JavaScript. ★ The need for external plugins (like Flash) needs to be reduced. ★ Error handling should be easier than in previous versions. ★ Scripting has to be replaced by more markup. ★ HTML5 should be device-independent. ★ The development process should be visible to the public. 3
  • 4. 4
  • 5. Removed Elements <acronym> <abbr> <applet> <object> <dir> <ul> <basefont> <big> CSS <center> Redefined Elements ● New Semantics ● Simplified Syntax ● Character encoding ● Optional type attributes ● Optional solidus (/>) New Elements ● Sectioning Elements ● Inline Elements ● Interactive Elements } 5
  • 6. The following HTML 4 elements have been removed from HTML5: <acronym> <applet> <basefont> <big> <center> <dir> <frameset> <noframes> <strike> <tt> <font> <frame> 6
  • 7. New Doctype <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1- transitional.dtd"> 7 <!DOCTYPE html>
  • 9. The Figure Element <img src="path/to/image" alt="About image" /> <p>Image of Mars. </p> 9 <figure> <img src="path/to/image" alt="About image" /> <figcaption> <p>This is an image of something interesting. </p> </figcaption> </figure>
  • 10. Form Handling... ● Input Types ○ Email input ○ datetime ○ Color ○ URL ○ Sliders with the Range Input ● Input Attributes ○ Placeholder ○ Required Attribute ○ Autofocus Attribute ● Regular Expressions 10 ● New Form Elements <datalist> pre-defined options for input controls <keygen> key-pair generator field <output> result of a calculation
  • 12. 12 HTML5 adds a number of new semantic HTML tags to give a better definition to the various parts (elements) that form the structure of a webpage.
  • 15. Canvas ● The HTML <canvas> element is used to draw graphics, on the fly, via scripting (usually JavaScript). ● The <canvas> element is only a container for graphics. You must use a script to actually draw the graphics. ● Canvas has several methods for drawing paths, boxes, circles, text, and adding images. 15
  • 16. HTML5 Graphics <audio> Sound or music content <embed> Containers for external applications (plug-ins) <source> Sources for <video> and <audio> <track> Tracks for <video> and <audio> <video> Video or movie content 16
  • 17. <embed> Containers for external applications (plug-ins) <embed type="video/quicktime" src="movie.mov" width="640" height="480"> 17
  • 18. <audio> <audio src="audio.ogg" controls autoplay loop> <p>Your browser does not support the <code>audio</code> element </p> </audio> 18 ● controls : Displays the standard HTML5 controls for the audio on the web page. ● autoplay : Makes the audio play automatically. ● loop : Make the audio repeat (loop) automatically.
  • 19. <video> <video src="http://v2v.cc/~j/theora_testsuite/320x240.ogg" controls> Your browser does not support the <code>video</code> element. </video> 19
  • 20. HTML5 Local Storage Web applications can store data locally within the user's browser; instead of cookies, included in every server request. More secure Large amounts of data can be stored locally (~ 5MB) Information is never transferred to the server. 20
  • 21. window.localStorage ● Stores data with no expiration date ● It is per origin (per domain and protocol) All pages, from one origin, can store and access the same data. 21 window.sessionStorage ● Stores data for one session (data is lost when the browser tab is closed)
  • 22. <div id="result"></div> <script> // Check browser support if (typeof(Storage) !== "undefined") { // Store localStorage.setItem("lastname", "Smith"); // Retrieve document.getElementById("result").innerHTML = localStorage.getItem("lastname"); } else { document.getElementById("result").innerHTML = "Sorry, your browser does not support Web Storage..."; } </script> 22
  • 23. HTML5 Style Guide and Coding Conventions (1) ★ Use Correct Document Type ★ Use Lower Case ○ Element Names ○ Attribute Names ○ File Names ★ Close All HTML Elements < tag > … </tag> ★ Close Empty HTML Elements < tag /> 23
  • 24. HTML5 Style Guide and Coding Conventions (2) ★ Quote Attribute Values ○ <table class="table striped"> ★ Image Attributes - alt, size ★ Do not omit <html> and <body> ★ Metadata - Language and the character encoding should be defined as early as possible in a document 24
  • 25. HTML5 Style Guide and Coding Conventions (3) ★ Avoid Long Code Lines ★ Blank Lines and Indentation ○ Blank lines to separate large or logical code blocks. ○ Add 2 spaces of indentation. Do not use TAB. ★ Style Sheets ○ Use simple syntax (the type attribute is not necessary) ○ Short rules can be written compressed, on one line. ○ Long rules should be written over multiple lines 25