XHTML. XHTML stands for EXtensible HyperText Markup Language. XHTML is the next generation of HTML. XHTML is almost identical to HTML 4.

Similar documents
Module 2 (III): XHTML

XHTML & CSS CASCADING STYLE SHEETS

Chapter 2:- Introduction to XHTML. Compiled By:- Sanjay Patel Assistant Professor, SVBIT.

HTML Overview. With an emphasis on XHTML

Motivation (WWW) Markup Languages (defined). 7/15/2012. CISC1600-SummerII2012-Raphael-lec2 1. Agenda

Understanding the Web Design Environment. Principles of Web Design, Third Edition

What is XHTML? XHTML is the language used to create and organize a web page:

HTML. Mohammed Alhessi M.Sc. Geomatics Engineering. Internet GIS Technologies كلية اآلداب - قسم الجغرافيا نظم المعلومات الجغرافية

Session 23 XML. XML Reading and Reference. Reading. Reference: Session 23 XML. Robert Kelly, 2018

(1) I (2) S (3) P allow subscribers to connect to the (4) often provide basic services such as (5) (6)

HTML HTML/XHTML HTML / XHTML HTML HTML: XHTML: (extensible HTML) Loose syntax Few syntactic rules: not enforced by HTML processors.

Web Development & Design Foundations with XHTML. Chapter 2 Key Concepts

Creating A Web Page. Computer Concepts I and II. Sue Norris

Scripting for Multimedia LECTURE 1: INTRODUCING HTML5

Chapter 10: Understanding the Standards

Structured documents

COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2018)

CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0

A network is a group of two or more computers that are connected to share resources and information.

Extensible Markup Language (XML) Hamid Zarrabi-Zadeh Web Programming Fall 2013

1. Please, please, please look at the style sheets job aid that I sent to you some time ago in conjunction with this document.

Implementing Web Content

introduction to XHTML

bur,:{ f 2

CSI 3140 WWW Structures, Techniques and Standards. Markup Languages: XHTML 1.0

COMSC-030 Web Site Development- Part 1. Part-Time Instructor: Joenil Mistal

XHTML CHAPTER 16. Chapter 16

Announcements. Paper due this Wednesday

HTML & XHTML Tag Quick Reference

Web Design and Development ACS Chapter 3. Document Setup

Introduction to Web Development

FUNDAMENTALS OF WEB DESIGN (46)

INTRODUCTION TO WEB USING HTML What is HTML?

HTML is a mark-up language, in that it specifies the roles the different parts of the document are to play.

Markup Languages SGML, HTML, XML, XHTML. CS 431 February 13, 2006 Carl Lagoze Cornell University

Duke Library Website Preliminary Accessibility Assessment

Lecture 2: Tools & Concepts

Why HTML5? Why not XHTML2? Learning from history how to drive the future of the Web

User Interaction: XML and JSON

Appendix A. XHTML 1.1 Module Reference

Advanced HTML Scripting WebGUI Users Conference

HTML Overview formerly a Quick Review

CS144 Notes: Web Standards

3. Markup Languages and Formatting

but XML goes far beyond HTML: it describes data

Tutorial 1 Getting Started with HTML5. HTML, CSS, and Dynamic HTML 5 TH EDITION

XHTML 1.0: The Extensible HyperText Markup

Unit 5 Web Publishing Systems Page 1 of 13 Part 4 HTML Part 4

CMT111-01/M1: HTML & Dreamweaver. Creating an HTML Document

CSC309 Tutorial CSS & XHTML

History of the Internet. The Internet - A Huge Virtual Network. Global Information Infrastructure. Client Server Network Connectivity

What is a web site? Web editors Introduction to HTML (Hyper Text Markup Language)

Web Development IB PRECISION EXAMS

HTML: The Basics & Block Elements

DIPLOMA IN WEB DESIGNING

c122jan2714.notebook January 27, 2014

Background of HTML and the Internet

Introduction to HTML5


Announcements. 1. Class webpage: Have you been reading the announcements? Lecture slides and coding examples will be posted

COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2017)

From administrivia to what really matters

Create web pages in HTML with a text editor, following the rules of XHTML syntax and using appropriate HTML tags Create a web page that includes

Announcements. 1. Class webpage: Have you been reading the announcements? Lecture slides and coding examples will be posted

Bridges To Computing

White Paper. elcome to Nokia s WAP 2.0 XHTML browser for small devices. Advantages of XHTML for Wireless Data

Aleph - Web Opac Accessibility. Accessibility in Aleph500 Web OPAC

Developing a Basic Web Page

HTML. Hypertext Markup Language. Code used to create web pages

Advanced Web Programming C2. Basic Web Technologies

XML: Introduction. !important Declaration... 9:11 #FIXED... 7:5 #IMPLIED... 7:5 #REQUIRED... Directive... 9:11

XML/XHTML ESA 2008/2009. Eelco Schatborn 11 september 2008

Chapter 1 Getting Started with HTML 5 1. Chapter 2 Introduction to New Elements in HTML 5 21

Programmazione Web a.a. 2017/2018 HTML5

Hypertext Markup Language, or HTML, is a markup

Comm 244 Week 3. Navigation. Navigation. Websites need a formalized system of links to allow users to navigate the site

HTML TUTORIAL ONE. Understanding What XHTML is Not

ESPRIT Project N Work Package H User Access. Survey

Solutions. a. Yes b. No c. Cannot be determined without the DTD. d. Schema. 9. Explain the term extensible. 10. What is an attribute?

XML (Extensible Markup Language

INTERNET PROGRAMMING XML

Web Publishing Basics I

Study Guide 2 - HTML and CSS - Chap. 6,8,10,11,12 Name - Alexia Bernardo

W3C XML XML Overview

JavaScript Context. INFO/CSE 100, Spring 2005 Fluency in Information Technology.

HTML -

CIS 408 Internet Computing. Dr. Sunnie Chung Dept. of Electrical Engineering and Computer Science Cleveland State University

Semantic Web Lecture Part 1. Prof. Do van Thanh

Comp 336/436 - Markup Languages. Fall Semester Week 2. Dr Nick Hayward

Anatomy of an HTML document

(from Chapter 5 & 25.6 of the text)

Navigation. Websites need a formalized system of links to allow users to navigate the site

Text and Layout. Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 11. This presentation 2004, MacAvon Media Productions

1. The basic building block of an HTML document is called a(n) a. tag. b. element. c. attribute. d. container. Answer: b Page 5

CMPT 165 Unit 2 Markup Part 2

Obsoletes: 2070, 1980, 1942, 1867, 1866 Category: Informational June 2000

Modify cmp.htm, contactme.htm and create scheduleme.htm

Chapter 1 Introduction to HTML, XHTML, and CSS

XML (Extensible Markup Language)

HTML, XHTML, and CSS. Sixth Edition. Chapter 1. Introduction to HTML, XHTML, and

Transcription:

3 XHTML What is XHTML? XHTML stands for EXtensible HyperText Markup Language XHTML is the next generation of HTML 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 a reformulation of HTML into a language that conforms to the XML 1.0 Recommendation XHTML Family document types are all XML-based, and ultimately are designed to work in conjunction with XML-based user agents 1

Why XHTML? XHTML is a combination of HTML and XML XML is a markup language where everything has to be marked up correctly, which results in "well-formed" documents 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 XHTML pages can be read by all XML enabled devices How is XHTML better than HTML? Extensibility: it is a metalanguage, which enables one to write a Document Type Definition (DTD) and define the rules of the language so the document can be interpreted by the document receiver. Portability: much of Internet access could be carried out on non-pc platforms such as palm computers, televisions, automobiles, telephones, etc. In most cases these devices will not have the computing power of a desktop computer, and will not be designed to accommodate ill-formed HTML as do current browsers (bloated with code to handle sloppy or proprietary HTML). 2

Differences Between XHTML and HTML The Most Important Differences: 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> A common mistake in nested lists, is to forget that the inside list must be within an li element 3

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 4

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

Attribute Minimization is Forbidden HTML compact checked declare readonly disabled selected defer ismap nohref noshade nowrap multiple noresize XHTML compact="compact" checked="checked" declare="declare" readonly="readonly" disabled="disabled" selected="selected" defer="defer" ismap="ismap" nohref="nohref" noshade="noshade" nowrap="nowrap" multiple="multiple" 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. <img src="picture.gif" id="picture1" /> To make your XHTML compatible with today's browsers, you should add an extra space before the "/" symbol 6

Mandatory XHTML Elements All XHTML documents must have a DOCTYPE declaration This is a minimum XHTML document template: <!DOCTYPE...> <html> <head> <title>... </title> </head> <body>... </body> </html> XHTML Document Type Definitions (DTD) The <!DOCTYPE> is Mandatory The 3 Document Type Definitions DTD specifies the syntax of a web page in SGML An XHTML DTD describes in precise the allowed syntax and grammar of XHTML markup. There are currently 3 XHTML 1.0 document types: STRICT TRANSITIONAL FRAMESET 7

The 3 Document Type Definitions XHTML 1.0 Strict Use this when you want really clean markup, free of presentational clutter. Use this together with Cascading Style Sheets. XHTML 1.0 Transitional Use this when you need to take advantage of HTML's presentational features and when you want to support browsers that don't understand Cascading Style Sheets. XHTML 1.0 Frameset Use this when you want to use HTML Frames to partition the browser window into two or more frames. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> XHTML Validation An XHTML document is validated against a Document Type Definition (DTD) Test your XHTML with the W3C Validator http://validator.w3.org/ XHTML Tag List http://www.w3schools.com\xhtml\xhtml_reference.asp XHTML Attributes http://www.w3schools.com\xhtml\xhtml_standardattributes.asp 8

W3C Recommendations XHTML 1.0 (Recommendation since January 2000) Three "flavors" of XHTML 1.0: XHTML 1.0 Strict XHTML 1.0 Transitional XHTML 1.0 Frameset The complete XHTML Basic (Recommendation since December 2000) XHTML Basic is the second Recommendation in a series of XHTML specifications. The XHTML Basic document type includes the minimal set of modules required to be an XHTML Host Language document type. It includes images, forms, basic tables, and object support. It is designed for Web clients that do not support the full set of XHTML features; such as mobile phones, PDAs, pagers, and settop boxes. W3C Recommendations Modularization of XHTML (Recommendation since April 2001) Modularization of XHTML is the third Recommendation in a series of XHTML specifications. This Recommendation specifies an abstract modularization of XHTML and an implementation of the abstraction using XML Document Type Definitions (DTDs). This modularization provides a means for subsetting and extending XHTML, a feature needed for extending XHTML's reach onto emerging platforms. Modularization of XHTML will make it easier to combine with markup tags for things like vector graphics, multimedia, math, electronic commerce and more. 9

W3C Recommendations XHTML 1.1 - Module-based XHTML (Recommendation since May 2001) While XHTML 1.1 looks very similar to XHTML 1.0 Strict, it is designed to serve as the basis for future extended XHTML Family document types, and its modular design makes it easier to add other modules as needed or integrate itself into other markup languages. XHTML 2.0 (first working draft August 2002) XHTML 2.0 is a markup language intended for rich, portable web-based applications. While the ancestry of XHTML 2.0 comes from HTML 4, XHTML 1.0, and XHTML 1.1, it is not intended to be backward compatible with its earlier versions. Reading List W3Schools XHTML Tutorial 10