1376 Introduction to HyperText Markup Language 4: Part (Web hosting support)
1376 Introduction to HyperText Markup Language 4: Part 1 Appendix I Common Programming Error I.1 Forgetting to include end tags for elements that require them is a syntax error and can grossly affect the formatting and look of your page. Unlike conventional programming languages, a syntax error in HTML does not usually cause page display in browsers to fail completely. I.3 Editing HTML In this appendix we show how to write HTML in its source-code form. We create HTML documents using a text editor and store them in files with either the.html or .htm file name extension. A wide variety of text editors exist. We recommend that you initially use a text editor called Notepad, which is built into Windows. Notepad can be found inside the Accessories panel of your Program list, inside the Start menu. You can also download a free HTML source-code editor called HTML-Kit at www.chami.com/html-kit. Unix users can use popular text editors like vi or emacs. Good Programming Practice I.2 Assign names to your files that describe their functionality. This practice can help you identify documents faster. It also helps people who want to link to your page, by giving them an easier-to-remember name for the file. For example, if you are writing an HTML document that will display your products, you might want to call it products.html. As mentioned previously, errors in conventional programming languages like C, C++ and Visual Basic often prevent the program from running. Errors in HTML markup are usually not fatal. The browser will make its best effort at rendering the page, but will probably not display the page as you intended. The file name of your home page (the first of your HTML pages that a user sees when browsing your Web site) should be index.html, because when a browser does not request a specific file in a directory, the normal default Web server response is to return index.html (this may be different for your server) if it exists in that directory. For example, if you direct your browser to www.deitel.com, the server actually sends the file www.deitel.com/index.html to your browser. I.4 Common Elements Throughout these HTML appendices, we will present both HTML source code and a sample screen capture of the rendering of that HTML in Internet Explorer. Figure I.1 shows an HTML file that displays one line of text. Lines 1 and 2 are required in every HTML document and are used to specify the document type. The document type specifies which version of HTML is used in the document and can be used with a validation tool, such as the W3C s validator.w3.org, to ensure an HTML document conforms to the HTML recommendation. In these examples we create HTML version 4.01 documents. All of the examples in these appendices have been validated through the Web site validator.w3.org. The HTML document begins with the opening tag (line 3) and ends with the closing tag (line 17).
We recommend cheap and reliable webhost to host and run your web applications: Coldfusion Web Hosting services.