HTML and CSS Reference
be just about any editor—more about this subject in “Programs to Help You Write
HTML” section, later) can read them. HTML files contain the following:
The text of the page itself
HTML tags that indicate page elements, structure, formatting, and hypertext links
to other pages or to included media
Most HTML tags look something like the following:
<thetagname> affected text </thetagname>
The tag name itself (here, thetagname ) is enclosed in brackets ( < > ). HTML tags gener-
ally have a beginning and an ending tag surrounding the text they affect. The beginning
tag “turns on” a feature (such as headings, bold, and so on), and the ending tag turns it
off. Closing tags have the tag name preceded by a slash ( / ). The opening tag (for exam-
ple, <p> for paragraphs) and closing tag (for example, </p> for paragraphs) compose
what is officially called an HTML element .
Be aware of the difference between the forward slash (/) men-
tioned with relation to tags, and backslashes (\), which are used
by DOS and Windows in directory references on hard drives (as in
C:\window or other directory paths). If you accidentally use the
backslash in place of a forward slash in HTML, the browser won't
recognize the ending tags.
Not all HTML tags have both an opening and closing tag. Some tags are only one-sided,
and still other tags are containers that hold extra information and text inside the brackets.
XHTML 1.1, however, requires that all tags be closed. You'll learn the proper way to
open and close the tags as the topic progresses.
Another difference between HTML 4.0 and XHTML 1.1 relates to usage of lowercase
tags and attributes. HTML tags are not case-sensitive; that is, you can specify them in
uppercase, lowercase, or in any mixture. So, <HTML> is the same as <html> , which is the
same as <HtMl> . This isn't the case for XHTML 1.1, where all tag and attribute names
must be written in lowercase. To get you thinking in this mindset, the examples in this
book display tag and attribute names in bold lowercase text.
Search WWH ::