Introducing XHTML: Module C: Document Structure. Goals Understand how to use DTDsUnderstand how to use DTDs Understand the importance of backward compatibilityUnderstand.

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.
Web Development & Design Foundations with XHTML
Dr. Alexandra I. Cristea XHTML.
Elder L. Lionel Kendrick Of the First Quorum of the Seventy It has been from the beginning and it will be till the end that the natural man will have a.
1 HTML Standards & Compliance. 2 Minimum Required HTML tags: (must go in this order!)
1. Content – Collective term for all text, images, videos, etc. that you want to deliver to your audience. 2. Structure – How the content is placed on.
HTML/XML XHTML Authoring. Creating Tables  Table: An arrangement of horizontal rows and vertical columns. The intersection of a row and a column is called.
 Fundamentals of Web Design.  Describe the history and theory of XHTML  Understand the rules for creating valid XHTML documents  Apply a DTD to an.
Copyright © 2004 ProsoftTraining, All Rights Reserved. Lesson 3: XHTML Coding © 2007 Prosoft Learning Corporation All rights reserved ITD 110 Web Page.
History Leading to XHTML
HTML5 and CSS3 Illustrated Unit B: Getting Started with HTML
Upgrading to XHTML DECO 3001 Tutorial 1 – Part 2 Presented by Ji Soo Yoon 19 February 2004 Slides adopted from
Tutorial 9 Working with XHTML
HTML Hypertext Markup Language –First proposed by CERN in 1989 –It is non-linear so it allows you to jump from place to place –Markup refers to the structure.
XHTML 16-Apr-17.
XHTML1 Building Document Structure. XHTML2 Objectives In this chapter, you will: Learn how to create Extensible Hypertext Markup Language (XHTML) documents.
17-Jun-15 XHTML 2 What is XHTML? XHTML stands for Extensible Hypertext Markup Language XHTML is aimed to replace HTML.
Unit 2, cont. September 14 HTML,Validating your pages, Publishing your site.
Tutorial 9 Working with XHTML. XP Objectives Describe the history and theory of XHTML Understand the rules for creating valid XHTML documents Apply a.
Creating a Well-Formed Valid Document. 2 Objectives Introducing XHTML Creating a Well-Formed Document Creating a Valid Document Creating an XHTML Document.
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.
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
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.
XP The University of Akron Summit College Business Technology Department Computer Information Systems 2440: 140 Internet Tools Instructor: Enoch E. Damson.
ULI101 – XHTML Basics (Part II) What is Markup Language? XHTML vs. HTML General XHTML Rules Block Level XHTML Tags XHTML Validation.
HTML BASICS Creating Web Pages with HTML CIS 133 Web Programming Concepts 1.
Chapter 1 Understanding the Web Design Environment Principles of Web Design, 4 th Edition.
Week 1 Understanding the Web Design Environment. 1-2 HTML: Then and Now HTML is an application of the Standard Generalized Markup Language Intended to.
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)
3 XHTML.
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. Introduction to XHTML What Is XHTML? – XHTML stands for EXtensible HyperText Markup Language – XHTML is almost identical to HTML 4.01 – XHTML is.
A Basic Web Page. Chapter 2 Objectives HTML tags and elements Create a simple Web Page XHTML Line breaks and Paragraph divisions Basic HTML elements.
XP Tutorial 9 1 Working with XHTML. XP SGML 2 Standard Generalized Markup Language (SGML) A standard for specifying markup languages. Large, complex standard.
HTML: Hyptertext Markup Language Doman’s Sections.
Project 2 Web Page Design Creating and Editing a Web Page Pages
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Creating XHTML Documents Essentials for.
Fundamentals of Web Design Copyright ©2004  Department of Computer & Information Science Introducing XHTML: Module C: Document Structure.
Lecture: Web Design Assis. Prof. Freshta Hanif Ehsan Faculty of Computer Science Kabul Polytechnic University Spring Semester
1 Tutorial 11 Creating an XML Document Developing a Document for a Cooking Web Site.
HTML Basics Computers. What is an HTML file? *HTML is a format that tells a computer how to display a web page. The documents themselves are plain text.
HTML Basics. HTML Coding HTML Hypertext markup language The code used to create web pages.
XP Tutorial 9New Perspectives on HTML and XHTML, Comprehensive 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
Objective: To describe the evolution of the Internet and the Web. Explain the need for web standards. Describe universal design. Identify benefits of accessible.
Chapter 1 Introduction to JavaScript JavaScript, Third Edition.
XP Review 1 New Perspectives on JavaScript, Comprehensive1 Introducing HTML and XHTML Creating Web Pages with HTML.
CSCI N241: Fundamentals of Web Design Copyright ©2004  Department of Computer & Information Science Working with Frames.
Tutorial 9 Working with XHTML. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Describe the history and theory of XHTML.
Tutorial 9 Working with XHTML. XP Objectives Describe the history and theory of XHTML Understand the rules for creating valid XHTML documents Apply a.
XHTML1 Building Document Structure N100 Building a Simple Web Page.
XHTML1 Introduction to Web Pages N100 Building a Simple Web Page.
1 Introduction to HTML. 2 Definitions  W W W – World Wide Web.  HTML – HyperText Markup Language – The Language of Web Pages on the World Wide Web.
HTML5 and CSS3 Illustrated Unit B: Getting Started with HTML.
NOTEPAD++ Lab 1 1 Riham ALSmari. Why Notepad++ ?  Syntax highlighting  Tabbed document interface  Zooming  Indentation code  Find and replace over.
Creating a Well-Formed Valid Document
Tutorial 9 Working with XHTML
Tutorial 9 Working with XHTML
Using Cascading Style Sheets Module B: CSS Structure
Introducing HTML & XHTML:
Tutorial 9 Working with XHTML
محمد احمدی نیا XHTML محمد احمدی نیا
HTML5 and CSS3 Illustrated Unit B: Getting Started with HTML
Presentation transcript:

Introducing XHTML: Module C: Document Structure

Goals Understand how to use DTDsUnderstand how to use DTDs Understand the importance of backward compatibilityUnderstand the importance of backward compatibility Understand how to use block-level elementsUnderstand how to use block-level elements Understand how to use inline elementsUnderstand how to use inline elements

This is accomplished through the use of three DTDs: Transitional, Frameset, and StrictThis is accomplished through the use of three DTDs: Transitional, Frameset, and Strict Even though the XHTML DTDs are an improvement over HTML, they may still be too large for many types of user agentsEven though the XHTML DTDs are an improvement over HTML, they may still be too large for many types of user agents Creating XHTML Documents

This is accomplished through the use of three DTDs: Transitional, Frameset, and StrictThis is accomplished through the use of three DTDs: Transitional, Frameset, and Strict Even though the XHTML DTDs are an improvement over HTML, they may still be too large for many types of user agentsEven though the XHTML DTDs are an improvement over HTML, they may still be too large for many types of user agents Creating XHTML Documents

Many of the elements found in XHTML 1.0, such as graphics, tables, and frames, may not be useable on many user agents, such as PDAs or mobile phonesMany of the elements found in XHTML 1.0, such as graphics, tables, and frames, may not be useable on many user agents, such as PDAs or mobile phones Creating XHTML Documents

One big difference between XML and XHTML:One big difference between XML and XHTML: –Whereas XML does not contain any predefined elements, XHTML contains almost all the elements that are available in HTML Creating XHTML Documents

Backward Compatibility To be backward compatible with older browsers, you save XHTML documents with an extension of.html or.htm, just like HTML documentsTo be backward compatible with older browsers, you save XHTML documents with an extension of.html or.htm, just like HTML documents

Backward Compatibility You must follow several rules to ensure that the code within your XHTML documents is also backward compatibleYou must follow several rules to ensure that the code within your XHTML documents is also backward compatible XML requires that empty elements include a slash before the closing bracket to close the elementXML requires that empty elements include a slash before the closing bracket to close the element

Backward Compatibility Older browsers that do not support XML ignore the element when they see the slash immediately following the element name in an empty elementOlder browsers that do not support XML ignore the element when they see the slash immediately following the element name in an empty element

Backward Compatibility You can ensure that older browsers are able to read empty elements in a well-formed XHTML document by adding a space between the element name and the closing slashYou can ensure that older browsers are able to read empty elements in a well-formed XHTML document by adding a space between the element name and the closing slash

The Declaration An XHTML document must include a declaration and the,, and elementsAn XHTML document must include a declaration and the,, and elements

The Declaration The declaration states the XHTML version of the document and the XHTML DTD (Transitional, Frameset, or Strict) with which the document compliesThe declaration states the XHTML version of the document and the XHTML DTD (Transitional, Frameset, or Strict) with which the document complies

XHTML DTDs The World Wide Web Consortium (W3C) created XHTML to make the transition to XML-based Web pages easierThe World Wide Web Consortium (W3C) created XHTML to make the transition to XML-based Web pages easier To facilitate the transition, the W3C provided three types of XHTML DTDs: Transitional, Frameset, and StrictTo facilitate the transition, the W3C provided three types of XHTML DTDs: Transitional, Frameset, and Strict

Transitional DTD Elements and attributes that are considered to be obsolete and that will eventually be eliminated are said to be deprecated.Elements and attributes that are considered to be obsolete and that will eventually be eliminated are said to be deprecated. The Transitional DTD allows you to continue using deprecated elements along with the well-formed document requirements of XML.The Transitional DTD allows you to continue using deprecated elements along with the well-formed document requirements of XML.

Transitional DTD

Frameset DTD The Frameset DTD is identical to the transitional DTD, except that it includes the and elementsThe Frameset DTD is identical to the transitional DTD, except that it includes the and elements

Frameset DTD Allows you to split the browser window into two or more frames, which are independent, scrollable portions of a Web browser window, with each frame capable of displaying a separate URLAllows you to split the browser window into two or more frames, which are independent, scrollable portions of a Web browser window, with each frame capable of displaying a separate URL

Strict DTD The Strict DTD eliminates the elements that were deprecated in the Transitional DTD and Frameset DTDThe Strict DTD eliminates the elements that were deprecated in the Transitional DTD and Frameset DTD

Strict DTD The declaration for the Strict DTD is as follows:The declaration for the Strict DTD is as follows: <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” strict.dtd>

Validating Web Pages To ensure that an XHTML document is well formed and that its elements are valid, you need to use a validating parserTo ensure that an XHTML document is well formed and that its elements are valid, you need to use a validating parser

Validating Web Pages Validation checks that your XHTML document is well formed, and that the elements in your document are correctly written according to the element definitions in an associated DTD. You are not actually required to validate XHTML documents.Validation checks that your XHTML document is well formed, and that the elements in your document are correctly written according to the element definitions in an associated DTD. You are not actually required to validate XHTML documents.

Validating Web Pages If you do not validate an XHTML document and it contains errors, most Web browsers will probably treat it as an HTML document, ignore the errors, and render the page anywayIf you do not validate an XHTML document and it contains errors, most Web browsers will probably treat it as an HTML document, ignore the errors, and render the page anyway

Validating Web Pages Many XHTML validating parsers existMany XHTML validating parsers exist –One of the best available is the W3C MarkUp Validation Service, a free service that validates both HTML and XHTML –The W3C MarkUp Validation Service is located at

XHTML Elements and Attributes The data contained within an element’s opening and closing tags is referred to as its contentThe data contained within an element’s opening and closing tags is referred to as its content You must close empty elements by adding a space and a slash before the tag’s closing bracketYou must close empty elements by adding a space and a slash before the tag’s closing bracket

Block-Level and Inline Elements Two basic types of elements can appear within a document’s element: block-level and inlineTwo basic types of elements can appear within a document’s element: block-level and inline –Block-level elements are elements that give a Web page its structure

Block-Level and Inline Elements –Inline, or text-level, elements describe the text that appears on a Web page –Unlike block-level elements, inline elements do not appear on their own lines; they appear within the line of the block-level element that contains them

Block-Level and Inline Elements

Standard Attributes You place attributes before the closing bracket of the starting tag, and you separate them from the tag name or other attributes with a spaceYou place attributes before the closing bracket of the starting tag, and you separate them from the tag name or other attributes with a space Many XHTML attributes are unique to a specific element or can only be used with certain types of elementsMany XHTML attributes are unique to a specific element or can only be used with certain types of elements

Standard Attributes XHTML also includes several standard, or common, attributes that are available to almost every element, with a few exceptionsXHTML also includes several standard, or common, attributes that are available to almost every element, with a few exceptions

Standard Attributes

In order to be a considerate resident of the international world of the Web, you should designate the language of your elements using the lang and xml:lang attributesIn order to be a considerate resident of the international world of the Web, you should designate the language of your elements using the lang and xml:lang attributes

Standard Attributes The lang attribute is used in HTML documents, whereas the xml:lang attribute is used in XML-based documentsThe lang attribute is used in HTML documents, whereas the xml:lang attribute is used in XML-based documents

Boolean Attributes A Boolean attribute specifies one of two values: true or falseA Boolean attribute specifies one of two values: true or false The presence of a Boolean attribute in an element’s opening tag indicates a value of “true”, whereas its absence indicates a value of “false”The presence of a Boolean attribute in an element’s opening tag indicates a value of “true”, whereas its absence indicates a value of “false”

Boolean Attributes When a Boolean attribute is not assigned a value, it is referred to as having a minimized formWhen a Boolean attribute is not assigned a value, it is referred to as having a minimized form Recall that all attribute values must appear within quotation marksRecall that all attribute values must appear within quotation marks

Boolean Attributes This syntax also means that an attribute must be assigned a valueThis syntax also means that an attribute must be assigned a value –For this reason, minimized Boolean attributes are illegal in XHTML You can still use Boolean attributes in XHTML provided you use their full formYou can still use Boolean attributes in XHTML provided you use their full form

Boolean Attributes You create the full form of a Boolean attribute by assigning the name of the other attribute itself as the attribute’s valueYou create the full form of a Boolean attribute by assigning the name of the other attribute itself as the attribute’s value

Required Elements To better understand how an XHTML document is structured, in this section you study in detail the three elements that must be included in every XHTML document: the,, and elementsTo better understand how an XHTML document is structured, in this section you study in detail the three elements that must be included in every XHTML document: the,, and elements

The Element All HTML documents must include an element, which tells a Web browser that the instructions between the opening and closing tags are to be assembled into an HTML documentAll HTML documents must include an element, which tells a Web browser that the instructions between the opening and closing tags are to be assembled into an HTML document

The Element The element is required and contains all the text and other elements that make up the HTML documentThe element is required and contains all the text and other elements that make up the HTML document

The Element The element is also the root element for XHTML documents and is required for XHTML documents to be well formedThe element is also the root element for XHTML documents and is required for XHTML documents to be well formed

The XHTML Namespace All of the predefined elements in an XHTML document are organized within the XHTML namespace that you declare in the elementAll of the predefined elements in an XHTML document are organized within the XHTML namespace that you declare in the element

The XHTML Namespace In order to understand what a namespace is, recall that you must define your own elements and attributes in an XML documentIn order to understand what a namespace is, recall that you must define your own elements and attributes in an XML document

The XHTML Namespace You identify each element by the namespace to which it belongsYou identify each element by the namespace to which it belongs A namespace organizes the elements and attributes of an XML document into separate groupsA namespace organizes the elements and attributes of an XML document into separate groups

The XHTML Namespace For elements, you add the namespace and colon before the tag name in both the opening and closing tagsFor elements, you add the namespace and colon before the tag name in both the opening and closing tags

The XHTML Namespace A default namespace is applied to all of the elements and attributes in an XHTML document, with the exception of elements and attributes to which local namespaces have been appliedA default namespace is applied to all of the elements and attributes in an XHTML document, with the exception of elements and attributes to which local namespaces have been applied

The XHTML Namespace You specify a default namespace for an XHTML document by using the xmlns namespace attribute in the elementYou specify a default namespace for an XHTML document by using the xmlns namespace attribute in the element

The Document Head The elements within a document’s head section contain information about the Web page itselfThe elements within a document’s head section contain information about the Web page itself

The Document Head The document head does not actually display any information in a browserThe document head does not actually display any information in a browser –Rather, it is a parent element that can contain several child elements A parent element is an element that contains other elements, known as child elementsA parent element is an element that contains other elements, known as child elements

Child Elements of the Element

The Document Body The document body is represented by the element and contains other elements that define all of the content a user sees rendered in a browserThe document body is represented by the element and contains other elements that define all of the content a user sees rendered in a browser

The Document Body XHTML documents consist of elements that contain content, as opposed to HTML documents, which consist of content that contains elementsXHTML documents consist of elements that contain content, as opposed to HTML documents, which consist of content that contains elements

The Document Body In HTML, you can also use various attributes in the element that affect the appearance of the document, such as the bgcolor attribute for setting the background color and the text attribute for setting the default color of textIn HTML, you can also use various attributes in the element that affect the appearance of the document, such as the bgcolor attribute for setting the background color and the text attribute for setting the default color of text

Basic Body Elements Basic body elements such as the and elements are some of the most frequently used elements in Web page authoringBasic body elements such as the and elements are some of the most frequently used elements in Web page authoring

Headings Heading elements are used for emphasizing a document’s headings and subheadings, which helps provide structure by hierarchically organizing a document’s contentHeading elements are used for emphasizing a document’s headings and subheadings, which helps provide structure by hierarchically organizing a document’s content There are six heading elements, through There are six heading elements, through

Paragraphs and Line Breaks The paragraph ( ) and line- break ( ) elements provide the simplest way of adding white space to a documentThe paragraph ( ) and line- break ( ) elements provide the simplest way of adding white space to a document

Paragraphs and Line Breaks White space refers to the empty areas on a pageWhite space refers to the empty areas on a page –It makes a page easier to read and is more visually appealing

Paragraphs and Line Breaks –It is tempting for beginning Web page authors to try and pack each page with as much information as possible, but experienced Web page authors know that the presence of white space is critical to the success of a page, whether you are creating a Web page or a traditional printed page

Horizontal Rules The empty horizontal-rule ( ) element draws a horizontal rule on a Web page that acts as a section dividerThe empty horizontal-rule ( ) element draws a horizontal rule on a Web page that acts as a section divider

Horizontal Rules Horizontal rules are useful visual elements for breaking up long documentsHorizontal rules are useful visual elements for breaking up long documents Although the element is technically a block-level element, it cannot contain any content because it is an empty elementAlthough the element is technically a block-level element, it cannot contain any content because it is an empty element

Comments Comments are nonprinting lines that you place in your code to contain various types of remarks.Comments are nonprinting lines that you place in your code to contain various types of remarks. XHTML comments begin with an opening comment tag XHTML comments begin with an opening comment tag

Web Page with Comments

Resources Slides were adapted from the following text & companion lectures:Slides were adapted from the following text & companion lectures: XHTML, Comprehensive First Edition Dan Gosselin Published by Course Technology (2004)