HTML and XHTML - Lesson 1
HTML stands for Hyper-Text Markup Language. Text means characters such as numbers or letters, and hyper-text then means these characters can act in an interactive manner, such as links. HTML is a language primarily used by web pages and other interactive media. The HTML language specifies a variety of design and usability characteristics that are rendered by the Browser that displays them.
XHTML is not a completely different language from HTML. Think of XHTML as a new version of HTML, Extensible Hyper-text Markup Language. Over time, more features were proposed to be added into web pages. New code was created to allow these new features. Some of these features allow for multimedia, others allow better and consistent layout.
There are 5 main versions of HTML: HTML 1.0, HTML 2.0, HTML 3.2, HTML 4.01, and XHTML 1.0. There is also XHTML 1.1 and a proposed XHTML 2.0.
XHTML is a very simple language. One does not need to be a programmer to understand it. XHTML is text written with very simple and logical code. The basics are that code is identified by a lowercase letter or group of lowercase letters within triangle brackets.
For example, to specify a paragraph in XHTML, you would use the <p> tag:
Code:
<p>
This is information placed between the paragraph tags to create a paragraph in an XHTML document.
</p>
Displays as:
This is information placed between the paragraph tags to create a paragraph in an XHTML document.
You will notice that the paragraph starts with the <p> tag, but ends with a similar tag with a slash, </p>. This is known as the closing tag, or in this case, the closing paragraph tag. This identifies the end of the paragraph in an XHTML document.
Here is another example. To make text bold in an XHTML document, use the bold set of tags, start with <b> and close with </b>:
Code:
<b>
This text will appear bold in an XHTML document.
</b>
Displays as:
This text will appear bold in an XHTML document.
As you can see, XHTML code is very simple. It requires sets of tags placed around information such as text. An opening tag and a closing tag.
You may run into code that only has one tag. For example, to create a horizontal rule (a line), only one tag is used. The reason is that there is no information between a horizontal rule. You simply type <hr /> and a horizontal rule is drawn. The tag has the closing slash inside itself.
Example:
Code:
<hr />
Displays as: