120 likes | 185 Views
Explore differences between HTML, XHTML, and HTML5, including structure, elements, attributes, and examples. Understand HTML5's new features like video, audio, graphics, and more.
E N D
National University of Computer and Emerging Sciences Lecture # 12 • HTML/ XHTML/ HTML5 CS 415 N-Tier Application Development By Umair Ashraf July 16 ,2013
Agenda/Contents for Today’s Lecture • Mid Term Exam SolutionDiscussion • Mid Term Exam Paper Review • HTML • XHTML • HTML5
What is XHTML? XHTML (Extensible Hypertext Markup Language) is a family of XML markup languages that mirror or extend versions of the widely used Hypertext Markup Language (HTML), the language in which web pages are written
XHTML • XHTML stands for EXtensible HyperText Markup Language • XHTML is almost identical to HTML • XHTML is a stricter and cleaner version of HTML • XHTML is HTML defined as an XML application • XHTML is supported by all major browsers.
The Most Important Differences from HTML • Document Structure • XHTML DOCTYPE is mandatory • The XML namespace attribute in <html> is mandatory • <html>, <head>, <title>, and <body> is mandatory • XHTML Elements • XHTML elements must be properly nested • XHTML elements must always be closed • XHTML elements must be in lowercase • XHTML documents must have one root element • XHTML Attributes • Attribute names must be in lower case • Attribute values must be quoted • Attribute minimization is forbidden
Example XHTML The example below shows an XHTML document with a minimum of required tags: <!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><title>Title of document</title></head><body>...... </body></html>
HTML5 • HTML5 is a markup language for structuring and presenting content for the World Wide Web and a core technology of the Internet. It is the fifth revision of the HTML standard (created in 1990 and standardized as HTML 4 as of 1997
HTML 5 Features • New Elements • New Attributes • Full CSS3 Support • Video and Audio • 2D/3D Graphics • Local Storage • Local SQL Database • Web Applications • With HTML5, playing video and audio is easier than ever With HTML5, drawing graphics is easier than ever
HTML 5 Example <!DOCTYPE HTML><html><body><video width="320" height="240" controls> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg"> Your browser does not support the video tag.</video></body></html>
How Did HTML5 Get Started? • HTML5 is a cooperation between the World Wide Web Consortium (W3C) and the Web Hypertext Application Technology Working Group (WHATWG). • WHATWG was working with web forms and applications, and W3C was working with XHTML 2.0. In 2006, they decided to cooperate and create a new version of HTML. • Some rules for HTML5 were established: • New features should be based on HTML, CSS, DOM, and JavaScript • Reduce the need for external plugins (like Flash) • Better error handling • More markup to replace scripting • HTML5 should be device independent • The development process should be visible to the public
HTML5 New Features • Some of the most interesting new features in HTML5: • The <canvas> element for 2D drawing • The <video> and <audio> elements for media playback • Support for local storage • New content-specific elements, like <article>, <footer>, <header>, <nav>, <section> • New form controls, like calendar, date, time, email, url, search
Reference Material http://www.w3schools.com/html/html_xhtml.asp http://www.w3schools.com/html/default.asp http://www.w3schools.com/html/html5_intro.asp