Download presentation
Presentation is loading. Please wait.
Published byBeatrice Jones Modified over 8 years ago
1
XHTML Basics
2
What is XHTML? XHTML is newer than, but built upon, the original HTML (Hyper Text Markup Language) platform. XHTML has stricter rules and does not allow some elements formerly used in HTML. One benefit of using XHTML is that it helps make web pages look identical in different browsers, such as Internet Explorer, Firefox, Safari, etc. XHTML is used to define and organize the page content but not to format or style it.
3
HTML first published 1991 2012 2002 - 2009 2000 HTML 2.0 HTML 3.2 HTML 4.01 XHTML 1.0 XHTML 2.0 HTML5 1995 1997 1999 HTML5 added powerful new features for creating web pages. It is still a work in progress but will eventually replace XHTML as the standard platform to build websites. After HTML 4.01 was released, focus shifted to XHTML and its stricter standards. XHTML 2.0 had even stricter standards than 1.0, but it fell out of favor gradually and was abandoned completely in 2009. The history of HTML: XHTML 1.0 is what we will learn in this course.
4
A basic XHTML document: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> My First Web Page Hello World
5
DOCTYPE must be specified on the first line: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> The DOCTYPE tells the web browser which language is being used for the set of instructions that follow. In this class, we will be using XHTML Transitional, which allows us more flexibility than XHTML Strict.
6
In XHTML, all elements must be in lowercase (the DOCTYPE line is not an element.) My First Web Page Hello World
7
Each element must have a beginning and an end: My First Web Page Hello World
8
Elements must be properly nested: My First Web Page Hello World
9
What is wrong with this? My Favorite Things Brown paper packages Tied up with strings
10
What is wrong with this? My Favorite Things Brown paper packages Tied up with strings The tags are overlapped.
11
White space doesn’t matter. The browser will ignore blank lines and multiple spaces: First Item Second Item First Item Second Item is the same as: We can take advantage of this fact by putting blank lines and indents in our code to make it easier to organize and read.
12
Summary of XHTML Basics: DOCTYPE must be specified first. All elements must be in lowercase. Each element must have a beginning and an end. Elements must be properly nested. White space doesn’t matter.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.