Posted on Aug 11, 2008
If you convert your manuscript into an HTML file, and then open it in a basic text editor, you will notice a lot of confusing tags - those things within the <>. Most are not at all necessary to a basic web page. They are formatting tags. In HTML all formating of the text must be specified in the code: location, font, font size, color, etc.
Most of this formating is there to mirror the formating of your manuscript in your word processor, of little use for a web page or a mobi file. The only tags you really need to properly format your text is the Heading <h>, Paragraph <p>, and link <a> tags. Other tags can be used for more advanced formating, but we shall get into that in a future post. For now let's start with the basics.
HTML tags must come in pairs. An opening and closing tag. The text between the tags will take on the characteristics specified by the tag. The closing tag is the same as the opening with a / added before the tag text thus: <p> and </p> The attributes of the opening tag will be applied until a closing tag is reached. If you forget the closing tag that will be the end of the document.
The Header tag tells a web browser, or an eBook reader, that the text is not just normal text. It is a heading or a title. There are standard headings which default to a particular size and font unless they are changed (this is more advanced). They are specified by using a number after the letter in the tag: <h1> <h2> and so on. These are used as chapter and section titles. The mobipocket creator will use these to create a table of contents.
The <p> and </p> tags surround your paragraphs. Browsers and readers have default settings for how to display the text, indention, space between paragraphs, etc. It is best to leave those formating decisions up to the browser or reader being used. Some devices have limits and settings you specify may not look the same on the device used by the reader.
The anchor tag, <a> and </a>, is the most powerful tag you will use for now. It can create a hyper link or a place where another link will come to. The most basic use is to create a link to another resource or web page. When this is done parameters are set for the links destination. An example sends a web browser to my home page when clicked: <a href="http://neolythics.com/"> some text </a> Let's look at the elements.
First is the inclusion of the href attribute. This tells the browser where the link leads to. This should be followed by and equal sign and the destination url in quotes. All of this should remain within the tag, the < and >. Any text between the opening tag and the closing tag will appear as clickable text. If you forget to close this tag the remainder of your text will be one long hyper link. Always close your tags.
In later posts I will get into other ways the anchor tag can be used. It can provide links within your manuscript for references, added content, and for a clickable table of contents. You can set the links to open not just at the beginning of a specified file but at a specific heading that has been set as an anchor. So anchors are launch points and destinations. They can make your manuscript come alive.
Loading comments...