HTML
From AbiWiki
HTML stands for HyperText Markup Language and is the primary language used by all Internet web sites. There is plenty of other places to find out how this works in a browser but this article will focus on its use with AbiWord. HTML files usually have an HTM or HTML extension. The page covers HTML through version 4. The latest version is called HTML5. See also XHTML.
Contents |
Ignoring Tags
A web browser is normally designed to ignore tags that is does not understand. However it expects a file to contain two sections, <Head> and <Body>. These are contained within a overall section called <HTML>. Ebook Readers will behave similarly but when a file is used as a source file it will often complain about entries it does not understand. More and more HTML is expected to conform to the idea of XHTML where the rules are more stringent.
Most other applications do not require a head section and may not even need the body tag. Tags that are recognized but not needed will simply be ignored.
Fonts and Characters
Data in HTML files will be displayed using a default set of fonts and a default set of characters unless specified in the file or CSS file. The W3C standard requires that a character set be specified. For example:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
will be specified as a line in the <head> section of the file. It can also be at the beginning in the style of XML. However many eBook readers are not able to decode meta statements. Certain special characters can be shown using the Entity reference capability.
Supported Tags
This section needs information on any limitations in AbiWord with regard to tags. --To be supplied--
Style Sheets
HTML standards encourage the use of Style Sheets and CSS (Cascading Style Sheets) are the preferred form. However the use of these is optional. CSS style sheets can be in one or more separate files and can also be listed in between <STYLE> and </STYLE> keywords in the <HEAD> section of the document. If they are in a separate document then a pointer is needed in the <HEAD> section. For example:
<link rel="stylesheet" href="style.css" type="text/css" />
The Style attribute can also be used in other tags within the <BODY> of the document. When there is more that one style that could be used most specific reference will override the same entry in other places.
Style sheets do not have to be complicated. A simple style sheet might look like:
body {margin-left:2; x-sbp-widow-push:2; x-sbp-orphan-pull:1; margin-right:1 } h2, h1 {text-align:"center"}
Attributes
A tag can contain attributes within the opening tag. These are property=value pairs. Some attributes are unique to particular tags but some can be used in any tag although they may not serve any useful purpose. Among the universal tags there are:
- lang - will specify the target language for the tag and will override any less specific designation. It is a good idea to specify the language of the data at the beginning of the file. For example <HTML lang=en> could be used.
- style - As mention style sheets are the preferred method of specifying style but a style attribute can be used anywhere to override more general settings.
- id - Any section can have an id tag to provide a unique name to the section.
- title - A title can provide text to use for display if you hover over a tag. It can also be used to provide the equivalent of a footnote for the data within a particular tag.
Coding HTML
It is possible to hand code HTML but often it is generated as a translation from some other format. For example Word DOC files can be converted to HTML by Word itself. Often conversions are ugly with all kinds of extra coding and sometimes do not conform to the actual requires for HTML standards. One way to fix this code is a program called Htmltidy.
There are many specific tags for sections of a document such as h1, h2, h3, etc. for headers and p for paragraphs. A universal div tag can be used anytime to divide the section for any purpose. Many other tags are defined in the standard.
For more information
http://www.w3.org/TR/REC-CSS1 - Style sheet standard.
http://www.w3.org/html/wiki/Specifications - The specification in wiki form.