What is XHTML?.

Slides:



Advertisements
Similar presentations
CSCI N241: Fundamentals of Web Design Copyright ©2004 Department of Computer & Information Science Introducing XHTML: Module B: HTML to XHTML.
Advertisements

XHTML Week Two Web Design. 2 What is XHTML? XHTML is the current standard for HTML Newest generation of HTML (post-HTML 4) but has many new features which.
Dr. Alexandra I. Cristea XHTML.
 Fundamentals of Web Design.  Describe the history and theory of XHTML  Understand the rules for creating valid XHTML documents  Apply a DTD to an.
Pengantar Teknologi Mobile 13 Antonius Rachmat C, S.Kom, M.Cs XHTML.
History Leading to XHTML
XHTML 16-Apr-17.
17-Jun-15 XHTML 2 What is XHTML? XHTML stands for Extensible Hypertext Markup Language XHTML is aimed to replace HTML.
Creating a Well-Formed Valid Document. 2 Objectives Introducing XHTML Creating a Well-Formed Document Creating a Valid Document Creating an XHTML Document.
F DIGITAL MEDIA: COMMUNICATION AND DESIGN INTRODUCTION TO XML AND XHTML.
HTML 4 - Introduction HTML stands for Hyper Text Markup Language. It is the standard format for documents on the World Wide Web. Just as Microsoft Word.
Upgrading to XHTML DECO 3001 Tutorial 1 – Part 1 Presented by Ji Soo Yoon 19 February 2004 Slides adopted from
Introducing XHTML: Module B: HTML to XHTML. Goals Understand how XHTML evolved as a language for Web delivery Understand the importance of DTDs Understand.
Introducing HTML & XHTML:. Goals  Understand hyperlinking  Understand how tags are formed and used.  Understand HTML as a markup language  Understand.
Computer Sciences Department
HTML & XHTML Introduction. First HTML 1992 Marked-up text to represent a hypertext document for transmission over the network The hypertext mark-up language.
Working with XHTML Creating a Well-Formed Valid Document.
XP Tutorial 9New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
_ HTML, XHTML & CSS Sami Niemelä | Module 1: Introduction to digital media: Day 02.
 XHTML is aimed to replace HTML  XHTML is almost identical to HTML 4.01  XHTML is a stricter and cleaner version of HTML  XHTML is HTML defined as.
CS 299 – Web Programming and Design Introduction to HTML.
XHTML - Basics Teppo Räisänen LIIKE/OAMK Introduction XHTML = eXtensible Hypertext Markup Language Transitional ~ HTML 4.01 Goal: to replace HTML.
CS134 Web Design & Development Creating a Basic Web Page Mehmud Abliz.
Chapter 1 XHTML: Part I The Web Warrior Guide to Web Design Technologies.
XHTML1 Building Document Structure Chapter 2. XHTML2 Objectives In this chapter, you will: Learn how to create Extensible Hypertext Markup Language (XHTML)
XHTML Presented by Kelly(Geun-young) Yim. Learning Objectives  List the difference between XHTML and HTML  Create a valid, well-formed XHTML document.
XHTML Presentation by Kevin See June 16, XML in HTML Meeting Report  May 11, 1998  html
3 XHTML.
Extensible HyperText Markup Language (XHTML) Laboratory of Intelligent Youn-Hee Han.
1 HTML XHTML. 2 Understand the Doctype tag Know the html tags which are now classed as depreciated Understand how Dreamweaver adds styles Add styles to.
1 XHTML محمد احمدی نیا 2 Of 19 HTML vs XHTML  XHTML is a stricter and cleaner version of HTML.  by combining the strengths of HTML.
XHTML Web and Database Management System. HTML’s History HTML was initially defined by Tim-Berners-Lee in 1990 at CERN (European Organization for Nuclear.
1 Web Developer Foundations: Using XHTML Chapter 2 Key Concepts.
XHTML. Introduction to XHTML What Is XHTML? – XHTML stands for EXtensible HyperText Markup Language – XHTML is almost identical to HTML 4.01 – XHTML is.
XP Tutorial 9 1 Working with XHTML. XP SGML 2 Standard Generalized Markup Language (SGML) A standard for specifying markup languages. Large, complex standard.
Lesson 4.
IT Engineering I Instructor: Rezvan Shiravi
WEB APPLICATION DEVELOPMENT For More visit:
Lecture: Web Design Assis. Prof. Freshta Hanif Ehsan Faculty of Computer Science Kabul Polytechnic University Spring Semester
Copyright © 2003 Pearson Education, Inc. Slide 1-1 Created by Cheryl M. Hughes The Web Wizard’s Guide to XHTML by Cheryl M. Hughes.
Extensible Markup Language (XML) Pat Morin COMP 2405.
XHTML. What Is XHTML? XHTML stands for EXtensible HyperText Markup Language XHTML is almost identical to HTML XHTML is stricter than HTML XHTML is HTML.
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
What is XHTML? XHTML stands for Extensible Hypertext Markup Language
CIS 228 The Internet 9/20/11 XHTML 1.0.
Creating a Well-Formed Valid Document
CITA 330 Section 3 XHTML.
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Introduction to HTML.
Building Blocks of a Web Page HTML, HTML 5, CSS & XHTML
Coding, Testing and Valdating a Web Page
W3C Web standards and Recommendations
3.00cs HTML Overview 3.00cs Develop webpages.
Basic HTML/xHTML.
Chapter 4 Introduction to XHTML: Part 1
Chapter 1: Introduction to XHTML (part 1)
INP150: Basic HTML Instructor: Paul J. Millis
WEBSITE DESIGN Chp 1
XHTML
Introducing HTML & XHTML:
HTML A brief introduction HTML.
XHTML Review Anita Philipp Updated Spring 2016.
Instructor: Charles Moen
Web Application Development
Creating a Basic Web Page
XHTML 7-May-19.
XHTML 29-May-19.
محمد احمدی نیا XHTML محمد احمدی نیا
Web Design & Development
Presentation transcript:

What is XHTML?

XHTML Stands for EXtensible HyperText Markup Language Is aimed to replace HTML Is almost identical to HTML 4.01 Is a stricter and cleaner version of HTML Is HTML defined as an XML application

XHTML Is The Official HTML Standard XHTML 1.0 became an official W3C Recommendation January 26, 2000. A W3C Recommendation means that the specification is stable, that it has been reviewed by the W3C membership, and that the specification is now a Web standard.

W3C defines XHTML as the latest version of HTML W3C defines XHTML as the latest version of HTML. XHTML will gradually replace HTML – or so it was thought!!!.

All New Browsers Support XHTML XHTML is compatible with HTML 4.01. All new browsers have support for XHTML. XHTML is a reformulation of HTML 4.01 in XML, and can be put to immediate use with existing browsers by following a few simple guidelines.

XHTML - Why? XHTML is a combination of HTML and XML (eXtensible Markup Language). XHTML consists of all the elements in HTML 4.01 combined with the syntax of XML. We have reached a point where many pages on the WWW contain ‘bad’ HTML. XML is a markup language where everything has to be marked up correctly, which results in ‘well-formed’ documents.

XML was designed to describe data and HTML was designed to display data.  Today's market consists of different browser technologies, some browsers run internet on computers, and some browsers run internet on mobile phones and ‘hand helds’. The last-mentioned do not have the resources or power to interpret a ‘bad’ markup language.

Therefore - by combining HTML and XML, and their strengths, we got a markup language that is useful now and in the future - XHTML. XHTML pages can be read by all XML enabled devices AND while waiting for the rest of the world to upgrade to XML supported browsers, XHTML gives you the opportunity to write ‘well-formed’ documents now, that work in all browsers and that are backward browser compatible !!!

XHTML vs HTML XHTML elements must be properly nested XHTML documents must be well-formed Tag names must be in lowercase All XHTML elements must be closed

Elements Must Be Properly Nested In HTML some elements can be improperly nested within each other like this: <b><i>This text is bold and italic</b></i> In XHTML all elements must be properly nested within each other like this: <b><i>This text is bold and italic</i></b>

Documents Must Be Well-formed All XHTML elements must be nested within the <html> root element. All other elements can have sub (children) elements. Sub elements must be in pairs and correctly nested within their parent element. The basic document structure is: <html> <head> ... </head> <body> ... </body> </html>

Tag Names Must Be in Lower Case This is because XHTML documents are XML applications. XML is case-sensitive. Tags like <br> and <BR> are interpreted as different tags. This is wrong: <BODY> <P>This is a paragraph</P> </BODY>

All XHTML Elements Must Be Closed Non-empty elements must have an end tag. 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 Empty elements must either have an end tag or the start tag must end with />. This is wrong: This is a break<br> Here comes a horizontal rule:<hr> Here's an image <img src="happy.gif" alt="Happy face">

This is correct: This is a break<br /> Here comes a horizontal rule:<hr /> Here's an image <img src="happy.gif" alt="Happy face" />

Some More XHTML Syntax Rules Attribute names must be in lower case Attribute values must be quoted Attribute minimization is forbidden The id attribute replaces the name attribute The XHTML DTD defines mandatory elements

Attribute Names Must Be In Lower Case This is wrong: <table WIDTH="100%"> This is correct: <table width="100%">

Attribute Values Must Be Quoted This is wrong: <table width=100%> This is correct: <table width="100%">

Attribute Minimization Is Forbidden This is wrong: <dl compact> <input checked> <input readonly> <input disabled> <option selected> <frame noresize>

This is correct: <dl compact="compact"> <input checked="checked" /> <input readonly="readonly" /> <input disabled="disabled" /> <option selected="selected" /> <frame noresize="noresize" />

The id Attribute Replaces The name Attribute HTML 4.01 defines a name attribute for the elements a, applet, frame, iframe, img, and map. In XHTML the name attribute is deprecated. Use id instead. This is wrong: <img src="picture.gif" name="picture1" /> This is correct: <img src="picture.gif" id="picture1" />

Mandatory XHTML Elements All XHTML documents must have a DOCTYPE declaration. The html, head and body elements must be present, and the title must be present inside the head element. This is a minimum XHTML document template:

<. DOCTYPE Doctype goes here> <html xmlns="http://www. w3 <!DOCTYPE Doctype goes here> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Title goes here</title> </head> <body> Body text goes here </body> </html>

The xmlns attribute inside the <html> tag is required in XHTML The xmlns attribute inside the <html> tag is required in XHTML. However, the validator on w3.org does not complain when this attribute is missing in an XHTML document. This is because "xmlns=http://www.w3.org/1999/xhtml" is a fixed value and will be added to the <html> tag even if you do not include it.

XHTML DTD The XHTML standard defines three Document Type Definitions. The most common is the XHTML Transitional. The <!DOCTYPE> Is Mandatory. The DOCTYPE declaration should always be the first line in an XHTML document.

An XHTML Example <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN“ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>simple document</title> </head> <body> <p>a simple paragraph</p> </body> </html>

The DOCTYPE declaration defines the document type: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

The 3 Document Type Definitions DTD is used by SGML applications, such as HTML or XHTML, to specify rules that apply to the markup of documents of a particular type, including a set of element and entity declarations. An XHTML DTD describes in precise, computer-readable language the allowed syntax and grammar of XHTML markup.

XHTML 1.0 specifies three XML document types that correspond to three DTDs: STRICT - includes elements and attributes that have not been deprecated or do not appear in framesets TRANSITIONAL - includes everything in the strict DTD plus deprecated elements and attributes FRAMESET - includes everything in the transitional DTD plus frames as well