Introduction to XHTML
What is it?
XHTML (or eXtensible Hypertext Markup Language) is a variant of HTML markup language, used to define the document structure of text, images, and other elements for the web. XHTML is a simple way of structuring information in plain-text (using a plain-text editor) via XHTML tags. This structured information can be interpreted in a meaningful way by a web browser, and presented as a webpage.
At its core, XHTML is a way of categorizing types of information. It is not a way of formatting a document, merely a way of defining the components of a document; however, a document full of semantically categorized information can be displayed in an intelligent way by software. For example, web browsers will usually display a piece of text as large and bold if that text is categorized as a heading.
In most web browsers, there is a “View Page Source” option. This can be used to view your current page in plain-text. Depending on what browser you are using, you can press ctrl + u (or command + u for Macs) to view the source code. This function works in Mozilla FireFox, which is one of the many reasons we require only this browser for completing E115 course assignments.
XHTML can be used to create a basic static webpage. In conjunction with the lessons in Chapter 8, this webpage can be flexibly styled and presented at your creative whim. The ability to easily create your own webpage allows you to share information over the world wide web and maintain a personal piece of virtual real estate. One great application of XHTML skills would be to create a professional web presence where you might present your resume and an autobiography.
The W3C, or World-Wide Web Consortium, is a standards organization tasked with developing standardized practices for web development. This group is responsible for drafting the specifications for XHTML, among other things; in other words, the W3C is the group which decides the “correct” way websites should be created.
The most recent specification for XHTML, according to the W3C governing body, is XHTML5. This version is considered greatly simplified from previous versions – cutting out redundancies and providing flexible options for organizational elements. The W3C provides a tool to ensure that your markup is strictly valid XHTML5 code called the W3C Validator.
This textbook only covers the basics of XHTML5. There are many aspects of the language which will not be covered here. To read more about XHTML5 features, or to get clarification for a certain topic, take a look at the Mozilla Developer Network. If you don’t mind some heavy technical reading, you can also read the official W3C technical specifications.
XHTML is a markup language written in plain-text. This means that XHTML should only be written in a plain-text editor, not in a word processing software. Word processing software inserts information into the text file about the text formatting (for example: font, color, font size, etc.), but does so in a format that is not compatible with XHTML. Plain-text editors, on the other hand, save only the text information with no implied formatting – this allows us to manually define all formatting in XHTML format.
Some plain-text editors are designed for writing markup and other code. These editors display the code with useful color formatting (which help you understand the code syntax) although that formatting is not saved in the file (it only exists to aide the code author). One such recommended (and free) software for Windows users is Notepad++, for Mac OSX users is TextWrangler, and for Linux users is Gedit.
- Understand the purpose and application of XHTML code.
- Understand the concept of valid code and code standards.
- Be able to read and modify an XHTML document.
- Create links, tables, and lists within an XHTML document.
- Be able to create a new XHTML document from scratch.