HTML and CSS Reference
In-Depth Information
<head>
< title>Page Title Goes Here</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
... body information goes here
</body>
</html>
FAQ
What if I'm using a Mac?
No worries! Use the Mac's built-in TextEdit application—but first you'll need to set some prefer-
ences. Launch TextEdit and select Preferences.
Set the new document format to plain text.
Set the saving option to not save documents with a .txt extension.
Set the rich text processing preference to: Ignore rich text commands in HTML files.
See http://support.apple.com/kb/TA20406 for more configuration information. Now you're
ready to edit Web pages with TextEdit! As you follow along with the topic, just launch TextEdit
when you are directed to use Notepad.
HANDS-ON PRACTICE 2.1
Launch Notepad or another text editor and type in the following XHTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>My First Web Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
Hello World
</body>
</html>
Notice that the first lines in the file contain the DTD. The XHTML code begins with an
opening <html> tag and ends with a closing </html> tag. The purpose of these tags is
to indicate that the content between the tags makes up a Web page. The head section is
delimited by <head> and </head> tags and contains a pair of title tags with the words
“My First Web Page” in between along with a <meta /> tag to indicate the character
encoding. The meta tag is used alone—it is not used as a pair of opening and closing
tags. It is considered to be a stand-alone or self-contained tag. Because you are using
XHTML (which follows XML syntax), the meta tag is coded with an ending />, which
indicates a self-contained tag. The body section is delimited by <body> and </body>
 
Search WWH ::




Custom Search