|
| How Spacing Effects HTML | |
Start your text editor (TeachText/Notepad) and enter the text that is
shown below between the two lines. Be sure to include the extra spaces and line breaks.
This is a sample. The first thing to learn is that spaces and breaks don't make a difference when displayed. Save the file on the floppy disk as "sample1.html". If you are a PC user and not using Windows 95, then save the file as "sample1.htm" since PC users can only have 3 characters for a file name extension. Start up Netscape (you shouldn't need to exit the text editor). Under the File menu select Open File... and open the file from the floppy disk. If you are using Windows 95, and the file is automaticly renamed to "sample1.html.txt" then you need to set up a .html filetype. What am I suppose to see? Notice that all of the text is compressed into a single paragraph, extra spaces are gone, and line breaks are translated into one space. Spacing doesn't make a difference to the browser. As always, there are exceptions to this rule, but for the most part, spacing is only used to make the HTML code easier to read to you, the author. If you have something where spacing is important, then you should explore using the <PRE> tag. However, unless it is absolutely necessary, you should let the browser do it's job of formatting the page. Side note... When you see this button, you can click it to see the sample code displayed as written. I strongly encourage you to take the time to enter each sample on your own. Typing the tags will help you remember them. |
|
http://www.ag.ohio-state.edu/~farmnet/ |