SlideShare a Scribd company logo
HTML VS XHTML
24-09-2018
1
• Yastee A. Shah
By:
• Web Technology
Subject:
2
WHAT ARE MARKUP LANGUAGES?
• Markup languages are the foundation of the web-where it all started, when websites
were just static pages with text and a little formatting.
• Essentially, everything you see on the web is a combination of markup (text),
cascading style sheets or CSS (design), and front-end scripts (interactivity). That
markup, made possible by HTML, is what creates a site’s foundation.
24-09-2018
3
*https://html.com/
HTML
• HTML was the first Internet-based language developed strictly for the web.
Anything displayed in a browser is organized via HTML.
• Structure
24-09-2018
4
XHTML (eXtensible Hypertext Markup
Language)
• XHTML is essentially identical to HTML4 (the fourth iteration of HTML), but with
elements of XML that extend HTML’s capabilities.
24-09-2018
5
*https://developer.mozilla.org/en-US/docs/Learn/HTML
In summary…
• HTML came along first, XHTML was designed to fix problems with HTML.
• They’re all mark up languages that provide structure and organization to the
content of webpages and applications, but their relevance has shifted as newer
versions of HTML have evolved, rising to the challenges of mobile demands,
responsive design, and developers who want to accomplish more with less.
24-09-2018
6
The Most Important Differences from HTML:
Document Structure
• XHTML DOCTYPE is mandatory
• The xmls attribute in <html> is mandatory
• <html>, <head>, <title>, and <body>
are mandatory <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head> <title>Title of document</title> </head>
<body>
some content
</body>
</html>
24-09-2018
7
XHTML Elements
• XHTML elements must be properly nested.
• XHTML elements must be always be closed
• XHTML elements must be in lowercase
• XHTML documents must have one root element
<html>
<head>
<title>This is bad HTML</title>
<body>
<h1>Bad HTML
<p>This is a paragraph
</body>
24-09-2018
8
XHTML Elements Must Always Be
Closed
This is wrong:
<p>This is a paragraph
<p>This is another paragraph
This is correct:
<p>This is a paragraph</p>
<p>This is another paragraph</p>
Empty Elements Must Also Be Closed
This is wrong:
A break: <br>
A horizontal rule: <hr>
An image: <img src="happy.gif" alt="Happy face">
This is correct:
A break: <br />
A horizontal rule: <hr />
An image: <img src="happy.gif" alt="Happy face" />
24-09-2018
9
XHTML Attributes
• Attribute names must be in lower case
• Attribute values must be quoted
• Attribute minimization is forbidden
24-09-2018
10
*http://www.htmldog.com/guides/
XHTML Attribute Names Must Be In Lower Case
This is wrong:
<table WIDTH="100%">
Attribute Values Must Be Quoted
This is wrong:
<table width=100%>
XHTML Elements Must Be In Lower Case
This is wrong:
<BODY>
<P>This is a paragraph</P>
</BODY>
This is correct:
<table width="100%">
This is correct:
<table width="100%">
This is correct:
<body>
<p>This is a paragraph</p>
</body>
24-09-2018
11
• Attribute Minimization Is Forbidden
Wrong:
<input type="checkbox" name="vehicle" value="car" checked />
Correct:
<input type="checkbox" name="vehicle" value="car" checked="checked"/>
Wrong:
<input type="text" name="lastname" disabled />
Correct:
<input type="text" name="lastname" disabled="disabled" />
24-09-2018
12
HTML vs. XHTML
24-09-2018
13
*https://www.edx.org/course/introduction-to-html-and-
javascript
HTML XHTML
Introduction Main markup language for creating web
pages and other information that can be
displayed in a web browser.
Family of XML markup languages that
extend versions of HTML.
Filename extension .html, .htm .xhtml, .xht, .xml, .html, .htm
Internet media type text/html application/xhtml+xml
Type of format Document file format Markup language
Stands for HyperText Markup Language Extensible HyperText Markup Language
14
HTML XHTML
Application Application of Standard Generalized Markup Language
(SGML).
Application ofXML
Function
Web pages are written in HTML. Extended version of HTML that is stricter
and XML-based.
Nature
Flexible framework requiring purely HTML specific.
Restrictive subset of XML and needs to be
parsed with standard XML parsers.
Origin Proposed byTim Berners-Lee in 1987. WorldWideWeb Consortium
Recommendation in 2000.
Versions HTML 2, HTML 3.2, HTML 4.0, HTML 5. XHTML 1, XHTML 1.1, XHTML 2, XHTML 5.15
Features of HTML vs XHTML documents
• HTML documents are composed of elements that have three components-
1. start tag
2.end tag; element attributes given within tags and actual, textual and graphic
content
3.including tags. (Tag is a keyword which is enclosed within angle brackets).
• XHTML documents has only one root element.
• All elements including variables must be in lower case, and values assigned
must be surrounded by quotes, closed and nested for being recognized.
24-09-2018
16
*https://www.codecademy.com/learn/learn-html
• The declaration of DOCTYPE would determine rules for documents to follow.
• The underlying syntax of HTML allows many shortcuts that XHTML does not, such as
elements with optional opening or closing tags, and even EMPTY elements which must
not have an end tag.
• XHTML requires all elements to have an opening tag or a closing tag. XHTML, however,
also introduces a new shortcut: an XHTML
• Tag may be opened and closed within the same tag, by including a slash before the end
of the tag like this: <br/>. A fix for this is to include a space before closing the tag, as
such: <br />.
24-09-2018
17
How to Convert from HTML to XHTML
• Add an XHTML <!DOCTYPE> to the first line of every page
• Add an xmlns attribute to the html element of every page
• Include xml:lang and lang attributes on elements assigning language.
• Change all element and attribute names to lowercase
• Close all empty elements
• Include close tags for elements that can have content but are empty: <html></html>
• Include an extra space in empty-element tags: <html />
• Quote all attribute values
• Do not include XML declaration.
24-09-2018
18
24-09-2018
19
It is actually pretty easy. You just have to:
•Change your DOCTYPE
•Change Some Meta Tags
•Close all your tags properly
•Surround inline tags with block tags
•Eliminate the use of a few tags
•Leave the styling to Cascading Style Sheets
How to migrate from XHTML to HTML
• The language for an element should be specified with a lang attribute rather than the
XHTML xml:lang attribute.
• Remove the XML namespace (xmlns=URI). HTML has no facilities for namespaces.
• Change the document type declaration from XHTML to HTML.
• If present, remove the XML declaration. (Typically this is: <?xml version="1.0"?>).
• Change the XML empty-element syntax to an HTML style empty element (<br/> to
<br>).
24-09-2018
20
21
24-09-2018
Ad

More Related Content

What's hot (20)

Css types internal, external and inline (1)
Css types internal, external and inline (1)Css types internal, external and inline (1)
Css types internal, external and inline (1)
Webtech Learning
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
yht4ever
 
Introduction to web programming with JavaScript
Introduction to web programming with JavaScriptIntroduction to web programming with JavaScript
Introduction to web programming with JavaScript
T11 Sessions
 
HTML/HTML5
HTML/HTML5HTML/HTML5
HTML/HTML5
People Strategists
 
HTML & CSS Masterclass
HTML & CSS MasterclassHTML & CSS Masterclass
HTML & CSS Masterclass
Bernardo Raposo
 
An Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java ScriptAn Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java Script
Fahim Abdullah
 
HTML5
HTML5HTML5
HTML5
Hatem Mahmoud
 
Dom
DomDom
Dom
Rakshita Upadhyay
 
Css selectors
Css selectorsCss selectors
Css selectors
Parth Trivedi
 
javaScript.ppt
javaScript.pptjavaScript.ppt
javaScript.ppt
sentayehu
 
Images and Tables in HTML
Images and Tables in HTMLImages and Tables in HTML
Images and Tables in HTML
Aarti P
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
Ravinder Kamboj
 
Java script
Java scriptJava script
Java script
Shyam Khant
 
Cookie & Session In ASP.NET
Cookie & Session In ASP.NETCookie & Session In ASP.NET
Cookie & Session In ASP.NET
ShingalaKrupa
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
WordPress Memphis
 
(Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS (Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS
Dave Kelly
 
Xhtml
XhtmlXhtml
Xhtml
Manav Prasad
 
The Box Model [CSS Introduction]
The Box Model [CSS Introduction]The Box Model [CSS Introduction]
The Box Model [CSS Introduction]
Nicole Ryan
 
Java script ppt
Java script pptJava script ppt
Java script ppt
The Health and Social Care Information Centre
 
CSS Transitions, Transforms, Animations
CSS Transitions, Transforms, Animations CSS Transitions, Transforms, Animations
CSS Transitions, Transforms, Animations
Rob LaPlaca
 

Similar to Html vs xhtml (20)

WT Module-1.pdf
WT Module-1.pdfWT Module-1.pdf
WT Module-1.pdf
RamyaH11
 
Html5
Html5 Html5
Html5
Shiva RamDam
 
IS221__Week1_Lecture chapter one, Web design.pptx
IS221__Week1_Lecture chapter one, Web design.pptxIS221__Week1_Lecture chapter one, Web design.pptx
IS221__Week1_Lecture chapter one, Web design.pptx
kumaranikethnavish
 
9781285852645_CH01 research and analysis of data.pptx
9781285852645_CH01 research and analysis of data.pptx9781285852645_CH01 research and analysis of data.pptx
9781285852645_CH01 research and analysis of data.pptx
clement swarnappa
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
Jonathan Arroyo
 
4_Traditional html vs xhtml.ppt
4_Traditional html vs xhtml.ppt4_Traditional html vs xhtml.ppt
4_Traditional html vs xhtml.ppt
VARNITBHASKAR1
 
Introduction to html course digital markerters
Introduction to html course digital markertersIntroduction to html course digital markerters
Introduction to html course digital markerters
SEO SKills
 
Web design - HTML (Hypertext Markup Language) introduction
Web design - HTML (Hypertext Markup Language) introductionWeb design - HTML (Hypertext Markup Language) introduction
Web design - HTML (Hypertext Markup Language) introduction
Mustafa Kamel Mohammadi
 
Introduction to HTML.pptx
Introduction to HTML.pptxIntroduction to HTML.pptx
Introduction to HTML.pptx
VaibhavSingh887876
 
Summary of-xhtml-basics
Summary of-xhtml-basicsSummary of-xhtml-basics
Summary of-xhtml-basics
starlanter
 
1. html introduction
1. html introduction1. html introduction
1. html introduction
Muhammad Toqeer
 
Lecture 2 introduction to html basics
Lecture 2 introduction to html basicsLecture 2 introduction to html basics
Lecture 2 introduction to html basics
AliMUSSA3
 
HTML & CSS.ppt
HTML & CSS.pptHTML & CSS.ppt
HTML & CSS.ppt
vaseemshaik21
 
Html basics
Html basicsHtml basics
Html basics
mcatahir947
 
html and css- 23091 3154 458-5d4341a0.ppt
html and css- 23091 3154 458-5d4341a0.ppthtml and css- 23091 3154 458-5d4341a0.ppt
html and css- 23091 3154 458-5d4341a0.ppt
ahoveida
 
Html presentation
Html presentationHtml presentation
Html presentation
Amber Bhaumik
 
Html.pptx
Html.pptxHtml.pptx
Html.pptx
SuhaibKhan62
 
2. HTML Basic unit2 fundamentals of computer
2. HTML Basic    unit2 fundamentals of computer2. HTML Basic    unit2 fundamentals of computer
2. HTML Basic unit2 fundamentals of computer
travelwithlifezindgi
 
Html (hypertext markup language)
Html (hypertext markup language)Html (hypertext markup language)
Html (hypertext markup language)
Resty Jay Galdo
 
Presentation html
Presentation   htmlPresentation   html
Presentation html
Billy Tierra
 
WT Module-1.pdf
WT Module-1.pdfWT Module-1.pdf
WT Module-1.pdf
RamyaH11
 
IS221__Week1_Lecture chapter one, Web design.pptx
IS221__Week1_Lecture chapter one, Web design.pptxIS221__Week1_Lecture chapter one, Web design.pptx
IS221__Week1_Lecture chapter one, Web design.pptx
kumaranikethnavish
 
9781285852645_CH01 research and analysis of data.pptx
9781285852645_CH01 research and analysis of data.pptx9781285852645_CH01 research and analysis of data.pptx
9781285852645_CH01 research and analysis of data.pptx
clement swarnappa
 
4_Traditional html vs xhtml.ppt
4_Traditional html vs xhtml.ppt4_Traditional html vs xhtml.ppt
4_Traditional html vs xhtml.ppt
VARNITBHASKAR1
 
Introduction to html course digital markerters
Introduction to html course digital markertersIntroduction to html course digital markerters
Introduction to html course digital markerters
SEO SKills
 
Web design - HTML (Hypertext Markup Language) introduction
Web design - HTML (Hypertext Markup Language) introductionWeb design - HTML (Hypertext Markup Language) introduction
Web design - HTML (Hypertext Markup Language) introduction
Mustafa Kamel Mohammadi
 
Summary of-xhtml-basics
Summary of-xhtml-basicsSummary of-xhtml-basics
Summary of-xhtml-basics
starlanter
 
Lecture 2 introduction to html basics
Lecture 2 introduction to html basicsLecture 2 introduction to html basics
Lecture 2 introduction to html basics
AliMUSSA3
 
html and css- 23091 3154 458-5d4341a0.ppt
html and css- 23091 3154 458-5d4341a0.ppthtml and css- 23091 3154 458-5d4341a0.ppt
html and css- 23091 3154 458-5d4341a0.ppt
ahoveida
 
2. HTML Basic unit2 fundamentals of computer
2. HTML Basic    unit2 fundamentals of computer2. HTML Basic    unit2 fundamentals of computer
2. HTML Basic unit2 fundamentals of computer
travelwithlifezindgi
 
Html (hypertext markup language)
Html (hypertext markup language)Html (hypertext markup language)
Html (hypertext markup language)
Resty Jay Galdo
 
Ad

More from Yastee Shah (11)

AWT.pptx
AWT.pptxAWT.pptx
AWT.pptx
Yastee Shah
 
jdbc vs hibernate.pptx
jdbc vs hibernate.pptxjdbc vs hibernate.pptx
jdbc vs hibernate.pptx
Yastee Shah
 
FIND MINIMUM TIME TO FINISH ALL JOBS WITH GIVEN CONSTRAINTS.pptx
FIND MINIMUM TIME TO FINISH ALL JOBS WITH GIVEN CONSTRAINTS.pptxFIND MINIMUM TIME TO FINISH ALL JOBS WITH GIVEN CONSTRAINTS.pptx
FIND MINIMUM TIME TO FINISH ALL JOBS WITH GIVEN CONSTRAINTS.pptx
Yastee Shah
 
Application of Queue.pptx
Application of Queue.pptxApplication of Queue.pptx
Application of Queue.pptx
Yastee Shah
 
Edison's work habits and thinking about failure.pptx
Edison's work habits and thinking about failure.pptxEdison's work habits and thinking about failure.pptx
Edison's work habits and thinking about failure.pptx
Yastee Shah
 
Smart grid.pptx
Smart grid.pptxSmart grid.pptx
Smart grid.pptx
Yastee Shah
 
Raid
RaidRaid
Raid
Yastee Shah
 
Water Level Indicator
Water Level IndicatorWater Level Indicator
Water Level Indicator
Yastee Shah
 
Types of virus and saviour
Types of virus and saviourTypes of virus and saviour
Types of virus and saviour
Yastee Shah
 
Output devices
Output devicesOutput devices
Output devices
Yastee Shah
 
Math
MathMath
Math
Yastee Shah
 
jdbc vs hibernate.pptx
jdbc vs hibernate.pptxjdbc vs hibernate.pptx
jdbc vs hibernate.pptx
Yastee Shah
 
FIND MINIMUM TIME TO FINISH ALL JOBS WITH GIVEN CONSTRAINTS.pptx
FIND MINIMUM TIME TO FINISH ALL JOBS WITH GIVEN CONSTRAINTS.pptxFIND MINIMUM TIME TO FINISH ALL JOBS WITH GIVEN CONSTRAINTS.pptx
FIND MINIMUM TIME TO FINISH ALL JOBS WITH GIVEN CONSTRAINTS.pptx
Yastee Shah
 
Application of Queue.pptx
Application of Queue.pptxApplication of Queue.pptx
Application of Queue.pptx
Yastee Shah
 
Edison's work habits and thinking about failure.pptx
Edison's work habits and thinking about failure.pptxEdison's work habits and thinking about failure.pptx
Edison's work habits and thinking about failure.pptx
Yastee Shah
 
Water Level Indicator
Water Level IndicatorWater Level Indicator
Water Level Indicator
Yastee Shah
 
Types of virus and saviour
Types of virus and saviourTypes of virus and saviour
Types of virus and saviour
Yastee Shah
 
Ad

Recently uploaded (20)

Venngage AI Infographic Generator- AI-powered visuals that turn your ideas in...
Venngage AI Infographic Generator- AI-powered visuals that turn your ideas in...Venngage AI Infographic Generator- AI-powered visuals that turn your ideas in...
Venngage AI Infographic Generator- AI-powered visuals that turn your ideas in...
Venngage AI Infographic Generator
 
2nd taxonomy, nomen microorganisms-.pptx
2nd  taxonomy, nomen  microorganisms-.pptx2nd  taxonomy, nomen  microorganisms-.pptx
2nd taxonomy, nomen microorganisms-.pptx
ayeleasefa2
 
masterddedeeeeeeeeedded seminar (1).pptx
masterddedeeeeeeeeedded seminar (1).pptxmasterddedeeeeeeeeedded seminar (1).pptx
masterddedeeeeeeeeedded seminar (1).pptx
tgavel7869
 
Internet Download Manager Crack Patch Latest IDM Free Download
Internet Download Manager Crack Patch Latest IDM Free DownloadInternet Download Manager Crack Patch Latest IDM Free Download
Internet Download Manager Crack Patch Latest IDM Free Download
Designer
 
An updated content measurement model - Elle Geraghty Content Strategy.pdf
An updated content measurement model - Elle Geraghty Content Strategy.pdfAn updated content measurement model - Elle Geraghty Content Strategy.pdf
An updated content measurement model - Elle Geraghty Content Strategy.pdf
Elle Geraghty
 
Lori Vanzant's portfolio. Please take a look!
Lori Vanzant's portfolio. Please take a look!Lori Vanzant's portfolio. Please take a look!
Lori Vanzant's portfolio. Please take a look!
vanzan01
 
mid-term all revisions g11 s1.pmdzs,zxptx
mid-term all revisions g11 s1.pmdzs,zxptxmid-term all revisions g11 s1.pmdzs,zxptx
mid-term all revisions g11 s1.pmdzs,zxptx
omar164646
 
presentation on healing architecture .pptx
presentation on healing architecture .pptxpresentation on healing architecture .pptx
presentation on healing architecture .pptx
buildnpl
 
Minimalist Pitch Deck by slide Slidesgo.pptx
Minimalist Pitch Deck by slide Slidesgo.pptxMinimalist Pitch Deck by slide Slidesgo.pptx
Minimalist Pitch Deck by slide Slidesgo.pptx
ESTEFANOANDREYGARCIA
 
Oversized Off White Pulka Dot Cotton Shirt
Oversized Off White Pulka Dot Cotton ShirtOversized Off White Pulka Dot Cotton Shirt
Oversized Off White Pulka Dot Cotton Shirt
ZNKL.in
 
STOCK ANALYSYS.pptx manajemen keuangan s
STOCK ANALYSYS.pptx manajemen keuangan sSTOCK ANALYSYS.pptx manajemen keuangan s
STOCK ANALYSYS.pptx manajemen keuangan s
kfdpontianak2012
 
Flowers Coloring Pages Activity Worksheet in Black and White Illustrative Style
Flowers Coloring Pages Activity Worksheet in Black and White Illustrative StyleFlowers Coloring Pages Activity Worksheet in Black and White Illustrative Style
Flowers Coloring Pages Activity Worksheet in Black and White Illustrative Style
Likazelika
 
PPT UNTUK ISU STRATEGIS (1).pptx PPT UNTUK ISU STRATEGIS (1).pptx
PPT UNTUK ISU STRATEGIS (1).pptx PPT UNTUK ISU STRATEGIS (1).pptxPPT UNTUK ISU STRATEGIS (1).pptx PPT UNTUK ISU STRATEGIS (1).pptx
PPT UNTUK ISU STRATEGIS (1).pptx PPT UNTUK ISU STRATEGIS (1).pptx
rachmatunnisa29
 
4K Video Downloader Crack (2025) + License Key Free
4K Video Downloader Crack (2025) + License Key Free4K Video Downloader Crack (2025) + License Key Free
4K Video Downloader Crack (2025) + License Key Free
Designer
 
Take this ppt refference and give content on mahindra commitment to sustainab...
Take this ppt refference and give content on mahindra commitment to sustainab...Take this ppt refference and give content on mahindra commitment to sustainab...
Take this ppt refference and give content on mahindra commitment to sustainab...
kochars428
 
10.1155-2024-1048933Figurefig0008.pptx.ppt
10.1155-2024-1048933Figurefig0008.pptx.ppt10.1155-2024-1048933Figurefig0008.pptx.ppt
10.1155-2024-1048933Figurefig0008.pptx.ppt
suchandasaha7
 
Prof House interior Design Project exter
Prof House interior Design Project exterProf House interior Design Project exter
Prof House interior Design Project exter
NagudiBridget
 
Baby panda 400.pdf de ciencias naturales
Baby panda 400.pdf de ciencias naturalesBaby panda 400.pdf de ciencias naturales
Baby panda 400.pdf de ciencias naturales
debbie loaiza
 
325295919-AAC-Blocks-Seminar-Presentation.pdf
325295919-AAC-Blocks-Seminar-Presentation.pdf325295919-AAC-Blocks-Seminar-Presentation.pdf
325295919-AAC-Blocks-Seminar-Presentation.pdf
shivsin165
 
Hi! I'm Lori Vanzant. Please take a look
Hi! I'm Lori Vanzant. Please take a lookHi! I'm Lori Vanzant. Please take a look
Hi! I'm Lori Vanzant. Please take a look
vanzan01
 
Venngage AI Infographic Generator- AI-powered visuals that turn your ideas in...
Venngage AI Infographic Generator- AI-powered visuals that turn your ideas in...Venngage AI Infographic Generator- AI-powered visuals that turn your ideas in...
Venngage AI Infographic Generator- AI-powered visuals that turn your ideas in...
Venngage AI Infographic Generator
 
2nd taxonomy, nomen microorganisms-.pptx
2nd  taxonomy, nomen  microorganisms-.pptx2nd  taxonomy, nomen  microorganisms-.pptx
2nd taxonomy, nomen microorganisms-.pptx
ayeleasefa2
 
masterddedeeeeeeeeedded seminar (1).pptx
masterddedeeeeeeeeedded seminar (1).pptxmasterddedeeeeeeeeedded seminar (1).pptx
masterddedeeeeeeeeedded seminar (1).pptx
tgavel7869
 
Internet Download Manager Crack Patch Latest IDM Free Download
Internet Download Manager Crack Patch Latest IDM Free DownloadInternet Download Manager Crack Patch Latest IDM Free Download
Internet Download Manager Crack Patch Latest IDM Free Download
Designer
 
An updated content measurement model - Elle Geraghty Content Strategy.pdf
An updated content measurement model - Elle Geraghty Content Strategy.pdfAn updated content measurement model - Elle Geraghty Content Strategy.pdf
An updated content measurement model - Elle Geraghty Content Strategy.pdf
Elle Geraghty
 
Lori Vanzant's portfolio. Please take a look!
Lori Vanzant's portfolio. Please take a look!Lori Vanzant's portfolio. Please take a look!
Lori Vanzant's portfolio. Please take a look!
vanzan01
 
mid-term all revisions g11 s1.pmdzs,zxptx
mid-term all revisions g11 s1.pmdzs,zxptxmid-term all revisions g11 s1.pmdzs,zxptx
mid-term all revisions g11 s1.pmdzs,zxptx
omar164646
 
presentation on healing architecture .pptx
presentation on healing architecture .pptxpresentation on healing architecture .pptx
presentation on healing architecture .pptx
buildnpl
 
Minimalist Pitch Deck by slide Slidesgo.pptx
Minimalist Pitch Deck by slide Slidesgo.pptxMinimalist Pitch Deck by slide Slidesgo.pptx
Minimalist Pitch Deck by slide Slidesgo.pptx
ESTEFANOANDREYGARCIA
 
Oversized Off White Pulka Dot Cotton Shirt
Oversized Off White Pulka Dot Cotton ShirtOversized Off White Pulka Dot Cotton Shirt
Oversized Off White Pulka Dot Cotton Shirt
ZNKL.in
 
STOCK ANALYSYS.pptx manajemen keuangan s
STOCK ANALYSYS.pptx manajemen keuangan sSTOCK ANALYSYS.pptx manajemen keuangan s
STOCK ANALYSYS.pptx manajemen keuangan s
kfdpontianak2012
 
Flowers Coloring Pages Activity Worksheet in Black and White Illustrative Style
Flowers Coloring Pages Activity Worksheet in Black and White Illustrative StyleFlowers Coloring Pages Activity Worksheet in Black and White Illustrative Style
Flowers Coloring Pages Activity Worksheet in Black and White Illustrative Style
Likazelika
 
PPT UNTUK ISU STRATEGIS (1).pptx PPT UNTUK ISU STRATEGIS (1).pptx
PPT UNTUK ISU STRATEGIS (1).pptx PPT UNTUK ISU STRATEGIS (1).pptxPPT UNTUK ISU STRATEGIS (1).pptx PPT UNTUK ISU STRATEGIS (1).pptx
PPT UNTUK ISU STRATEGIS (1).pptx PPT UNTUK ISU STRATEGIS (1).pptx
rachmatunnisa29
 
4K Video Downloader Crack (2025) + License Key Free
4K Video Downloader Crack (2025) + License Key Free4K Video Downloader Crack (2025) + License Key Free
4K Video Downloader Crack (2025) + License Key Free
Designer
 
Take this ppt refference and give content on mahindra commitment to sustainab...
Take this ppt refference and give content on mahindra commitment to sustainab...Take this ppt refference and give content on mahindra commitment to sustainab...
Take this ppt refference and give content on mahindra commitment to sustainab...
kochars428
 
10.1155-2024-1048933Figurefig0008.pptx.ppt
10.1155-2024-1048933Figurefig0008.pptx.ppt10.1155-2024-1048933Figurefig0008.pptx.ppt
10.1155-2024-1048933Figurefig0008.pptx.ppt
suchandasaha7
 
Prof House interior Design Project exter
Prof House interior Design Project exterProf House interior Design Project exter
Prof House interior Design Project exter
NagudiBridget
 
Baby panda 400.pdf de ciencias naturales
Baby panda 400.pdf de ciencias naturalesBaby panda 400.pdf de ciencias naturales
Baby panda 400.pdf de ciencias naturales
debbie loaiza
 
325295919-AAC-Blocks-Seminar-Presentation.pdf
325295919-AAC-Blocks-Seminar-Presentation.pdf325295919-AAC-Blocks-Seminar-Presentation.pdf
325295919-AAC-Blocks-Seminar-Presentation.pdf
shivsin165
 
Hi! I'm Lori Vanzant. Please take a look
Hi! I'm Lori Vanzant. Please take a lookHi! I'm Lori Vanzant. Please take a look
Hi! I'm Lori Vanzant. Please take a look
vanzan01
 

Html vs xhtml

  • 1. HTML VS XHTML 24-09-2018 1 • Yastee A. Shah By: • Web Technology Subject:
  • 2. 2
  • 3. WHAT ARE MARKUP LANGUAGES? • Markup languages are the foundation of the web-where it all started, when websites were just static pages with text and a little formatting. • Essentially, everything you see on the web is a combination of markup (text), cascading style sheets or CSS (design), and front-end scripts (interactivity). That markup, made possible by HTML, is what creates a site’s foundation. 24-09-2018 3 *https://html.com/
  • 4. HTML • HTML was the first Internet-based language developed strictly for the web. Anything displayed in a browser is organized via HTML. • Structure 24-09-2018 4
  • 5. XHTML (eXtensible Hypertext Markup Language) • XHTML is essentially identical to HTML4 (the fourth iteration of HTML), but with elements of XML that extend HTML’s capabilities. 24-09-2018 5 *https://developer.mozilla.org/en-US/docs/Learn/HTML
  • 6. In summary… • HTML came along first, XHTML was designed to fix problems with HTML. • They’re all mark up languages that provide structure and organization to the content of webpages and applications, but their relevance has shifted as newer versions of HTML have evolved, rising to the challenges of mobile demands, responsive design, and developers who want to accomplish more with less. 24-09-2018 6
  • 7. The Most Important Differences from HTML: Document Structure • XHTML DOCTYPE is mandatory • The xmls attribute in <html> is mandatory • <html>, <head>, <title>, and <body> are mandatory <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Title of document</title> </head> <body> some content </body> </html> 24-09-2018 7
  • 8. XHTML Elements • XHTML elements must be properly nested. • XHTML elements must be always be closed • XHTML elements must be in lowercase • XHTML documents must have one root element <html> <head> <title>This is bad HTML</title> <body> <h1>Bad HTML <p>This is a paragraph </body> 24-09-2018 8
  • 9. XHTML Elements Must Always Be Closed This is wrong: <p>This is a paragraph <p>This is another paragraph This is correct: <p>This is a paragraph</p> <p>This is another paragraph</p> Empty Elements Must Also Be Closed This is wrong: A break: <br> A horizontal rule: <hr> An image: <img src="happy.gif" alt="Happy face"> This is correct: A break: <br /> A horizontal rule: <hr /> An image: <img src="happy.gif" alt="Happy face" /> 24-09-2018 9
  • 10. XHTML Attributes • Attribute names must be in lower case • Attribute values must be quoted • Attribute minimization is forbidden 24-09-2018 10 *http://www.htmldog.com/guides/
  • 11. XHTML Attribute Names Must Be In Lower Case This is wrong: <table WIDTH="100%"> Attribute Values Must Be Quoted This is wrong: <table width=100%> XHTML Elements Must Be In Lower Case This is wrong: <BODY> <P>This is a paragraph</P> </BODY> This is correct: <table width="100%"> This is correct: <table width="100%"> This is correct: <body> <p>This is a paragraph</p> </body> 24-09-2018 11
  • 12. • Attribute Minimization Is Forbidden Wrong: <input type="checkbox" name="vehicle" value="car" checked /> Correct: <input type="checkbox" name="vehicle" value="car" checked="checked"/> Wrong: <input type="text" name="lastname" disabled /> Correct: <input type="text" name="lastname" disabled="disabled" /> 24-09-2018 12
  • 14. HTML XHTML Introduction Main markup language for creating web pages and other information that can be displayed in a web browser. Family of XML markup languages that extend versions of HTML. Filename extension .html, .htm .xhtml, .xht, .xml, .html, .htm Internet media type text/html application/xhtml+xml Type of format Document file format Markup language Stands for HyperText Markup Language Extensible HyperText Markup Language 14
  • 15. HTML XHTML Application Application of Standard Generalized Markup Language (SGML). Application ofXML Function Web pages are written in HTML. Extended version of HTML that is stricter and XML-based. Nature Flexible framework requiring purely HTML specific. Restrictive subset of XML and needs to be parsed with standard XML parsers. Origin Proposed byTim Berners-Lee in 1987. WorldWideWeb Consortium Recommendation in 2000. Versions HTML 2, HTML 3.2, HTML 4.0, HTML 5. XHTML 1, XHTML 1.1, XHTML 2, XHTML 5.15
  • 16. Features of HTML vs XHTML documents • HTML documents are composed of elements that have three components- 1. start tag 2.end tag; element attributes given within tags and actual, textual and graphic content 3.including tags. (Tag is a keyword which is enclosed within angle brackets). • XHTML documents has only one root element. • All elements including variables must be in lower case, and values assigned must be surrounded by quotes, closed and nested for being recognized. 24-09-2018 16 *https://www.codecademy.com/learn/learn-html
  • 17. • The declaration of DOCTYPE would determine rules for documents to follow. • The underlying syntax of HTML allows many shortcuts that XHTML does not, such as elements with optional opening or closing tags, and even EMPTY elements which must not have an end tag. • XHTML requires all elements to have an opening tag or a closing tag. XHTML, however, also introduces a new shortcut: an XHTML • Tag may be opened and closed within the same tag, by including a slash before the end of the tag like this: <br/>. A fix for this is to include a space before closing the tag, as such: <br />. 24-09-2018 17
  • 18. How to Convert from HTML to XHTML • Add an XHTML <!DOCTYPE> to the first line of every page • Add an xmlns attribute to the html element of every page • Include xml:lang and lang attributes on elements assigning language. • Change all element and attribute names to lowercase • Close all empty elements • Include close tags for elements that can have content but are empty: <html></html> • Include an extra space in empty-element tags: <html /> • Quote all attribute values • Do not include XML declaration. 24-09-2018 18
  • 19. 24-09-2018 19 It is actually pretty easy. You just have to: •Change your DOCTYPE •Change Some Meta Tags •Close all your tags properly •Surround inline tags with block tags •Eliminate the use of a few tags •Leave the styling to Cascading Style Sheets
  • 20. How to migrate from XHTML to HTML • The language for an element should be specified with a lang attribute rather than the XHTML xml:lang attribute. • Remove the XML namespace (xmlns=URI). HTML has no facilities for namespaces. • Change the document type declaration from XHTML to HTML. • If present, remove the XML declaration. (Typically this is: <?xml version="1.0"?>). • Change the XML empty-element syntax to an HTML style empty element (<br/> to <br>). 24-09-2018 20