Guide to Producing HTML Contents for Web Display

Chrys Forcha
Introduction
There are web sites over the Internet to which people can submit formatted text. A good example is a web site that allows people to submit articles. A good number of these web sites allow people to submit their text among HTML tags. The HTML tags have the formats (bold, indentation, spacing, justification, etc.). With these sites you do not submit the complete HTML document (which includes the HTML start and end tags, the head element, etc.). You submit only the part of the HTML document that will have your text.

HTML consists of tags defined by special characters, such as the > character. If your text (article) has these characters then the browser will not display your text properly, because it would interpret such characters as HTML code. This article offers a solution for this problem if you are submitting your text (article) as a set of HTML tags.

This article is for people who have basic knowledge in HTML.

Note: If you cannot see the code or if you think anything is missing (broken link), just contact me at forchatrans@yahoo.com. That is, contact me for the slightest problem you have about what has been typed.

Important Characters in Tags
An HTML tag begins with the < character and ends with the > character. The rest of the characters you find in a tag are characters, which you use in normal writing (typing). When you submit your HTML code to such a site, there is a program at the site that receives your code, adds the necessary HTML tags to it so that your code forms a complete HTML document. If this program is well written, then there are only two characters that you have to worry about in your text. These are the < and the > characters.

What you have submitted is HTML tags with text that the user would read. Your HTML tags are there for formatting. The user would read your text and this text may contain the < or > characters. The problem is with the < or > characters in the text that the user has to read. For the solution, these two tags have to be in their entity form. The entity for < is "" without the quotes. So all < and > in your text have to be replaced by "" without the quotes. The < and > characters for the tags remain as such; no replacement with entities. This is because the tags you submit have to be interpreted as HTML elements by the user's browser; not as text characters. On the browser display, these entities will appear as < and > and not < and > respectively.

So, if the program at the server is well written, all you have to worry about are the < and > characters in the text that the user would read. The tags you send that define HTML elements, remain in their normal form.

The Program not well written
If you think the program is not well written, then some special characters in the text (not the tags) would have to be replaced by their entities. These characters and their entities are as follows:

' or ' means apostrophe, that is '
" or " means quotation mark, that is "
or means non-breaking space
& or & means ampersand, that is &
¢ or ¢ means cent.
£ or £ means pound
¥ or ¥ means yen
§ or § means section
© or © means copyright
® or ® means registered trademark
× or × means multiplication
÷ or ÷ means division

If you replace these characters with their entities and the display at the user's browser is still not good, then the program at the server (that receives what you send) has to be fixed.

The PRE Element
The PRE HTML element is a double tag element. It is:

Content

If you are writing a poem, a mathematical solution, computer programming code or any text where you use the spacebar key and the Enter key to position text, then you should use the PRE element. They way you type the content of the PRE element, with the help of the spacebar and the Enter key, is the way the content will appear at the user's browser. As a writer of computer programming, I find the PRE element very handy.

Formatting Restrictions from some Sites
Some sites limit the type of tags that you can submit. They may say, you can submit the tag but not the tag. They may actually list the tags they allow you to submit. It is good to have this in mind if you plan to submit text and articles.

Conclusion
Tomorrow, you may find yourself having to submit text or article to a site that allows you to submit your material in HTML format. Remember, if the program that receives your material is well written, then you simply have to replace the < and > characters in your text with their HTML entities. If you do this and there is still a problem, try replacing the characters mentioned above with their entities; if your text can still not be displayed properly, then complain.

Published by Chrys Forcha

I have more than 10 years experience in computer programming, software, electronics and telecommunications. I have a First Degree in Electronics and a Master's Degree in Technical Education. As well a...  View profile

To comment, please sign in to your Yahoo! account, or sign up for a new account.