HTML and CSS Reference
In-Depth Information
What about the plethora of free and commercial HTML editors that offer to help you
write HTML more easily? Some are text editors that simplify common tasks associated
with HTML coding. If you have one of these editors, go ahead and use it. If you have a
fancier editor that claims to hide all the HTML for you, put it aside for the next couple
of lessons and try using a plain text editor just for a little while. Appendix A, “Sources of
Further Information,” lists many URLs where you can download free and commercial
HTML editors available for different platforms. They appear in the section titled “HTML
Editors and Converters.”
Open your text editor and type the following code. You don't have to understand what
any of it means at this point. You learn more about much of this in this lesson and the
following lesson. This simple example is just to get you started:
<!DOCTYPE html>< html >
< head >
< title >My Sample HTML Page< /title >
< /head >
< body >
< h1 >This is an HTML Page< /h1 >
< /body >
< /html >
NOTE
Note that the <!DOCTYPE> tag in the previous example doesn't
appear in lowercase like the rest of the tags. This tag is an excep-
tion to the XHTML rule and should appear in uppercase. The pur-
pose of the DOCTYPE is to tell validators and browsers which
specification your page was written to, in this case, HTML5. In
Lesson 19, “Designing for the Real World,” I talk about other
DOCTYPEs you'll see, and how to choose which one to use for
your pages.
After you create your HTML file, save it to your hard disk. Remember that if you're
using a word processor like Microsoft Word, choose Save As and make sure that you're
saving it as Text Only. When you choose a name for the file, follow these two rules:
The filename should have an extension of .html ( .htm is OK, but not preferred)—
for example, myfile.html , text.html , or index.htm . Most web software requires
your files to have these extensions, so get into the habit of doing it now. (If you use
Windows, make sure that your computer is configured to show file extensions. If it
isn't, you'll find yourself creating files named things like myfile.html.txt , which
your browser will not think are HTML files.)
n
 
Search WWH ::




Custom Search