As you begin to think about what you would like to put on your Web site, you might be wondering about material that you already have written but that is not “Web ready” yet. Maybe you have some recipes or short stories you’ve written. Or you might want to put your company’s employee manual online. Will you have to retype all that information? Not if you learn how to convert it to HTML. Although it’s possible to have a word processor save a file in HTML format, it’s not a great idea. Word processors tend to generate messy HTML. Besides, it’s quite easy to convert text to HTML.
Importing text into your HTML document is as easy as using the cut and paste options in Windows. However, when you import your text, you will notice that it has lost all of its formatting.You will learn in Chapter 2 how to use HTML elements to redefine the structure of your text.
Open template.htm in Notepad.
Open the document you want to import in your word processing program.
Select the text you want to import and copy it to the clipboard.
In Notepad, paste the text in between the <body> tags and then save the document under a different file name (so you don’t ruin your template).
Now, display the page in your browser.
When you import text into an HTML document, it loses any formatting it originally had. It will simply appear as a solid block of text. If you want the material you imported to be organized or structured in some way, you’ll have to do it with HTML elements. In the next couple of chapters, you’ll learn how to take your text and shape it up with text elements.
Another way to transform material you already have into a Web page is to simply save the file as a text file (but using an HTML extension). Then add the necessary HTML tags (see Figure 1-3). The main thing to remember is that you must save the file as a plain text file, not as a word processor file. Otherwise, the word processor’s codes will interfere with your HTML.
Figure 1-3: A word processor document with HTML tags added
Open the file you want to convert to HTML.
At the top of the document, type <html><head><title>Convert Text</title> </head><body>.
At the end of the document, type </body></html>.
From the File menu, choose Save As.
Choose Save As Text and name the file convert.htm.
Open the file in your browser.