The manual Page
Version française
   
index | glossary | news | downloads | links ]
  HTML
introduction
structure of
HTML pages

HTML tags
HTML attributes
text formatting
 
news
glossary
links
downloads
 
credits
contact
 
 
search
 
last update
19/02/2003
Valid HTML 4.0!
Valid CSS!
Hit-Parade
Mesurez votre audience


  Text formatting in HTML

HTML gives tags to format text. Here are the main of them.

Tags

<ABBR> abbreviation
<ACRONYM> acronym
<ADDRESS> information on author
<B> bold
<BIG> big text
<BLOCKQUOTE> long quotation
<CITE> reference
<CODE> code (program)
<DEL> old (deprecated) element
<DFN> instance definition or declaration
<EM> emphasis
<I> italic
<INS> new element (opposed to <DEL>)
<KBD> text to be entered by the user
<Q> short (inline) quotation
<S> strike-through
<SAMP> code sample
<SMALL> small
<STRIKE> strike-through
<STRONG> strong emphasis
<SUB> subscript
<SUP> superscript
<TT> TeleType or monospaced text style
<U> underlined
<VAR> instance or program variable

One uses these tags the same way: <TAG>words to be formatted</TAG>.

<ABBR>

Used to highlight abbreviations. Example: WWW or HTTP

Web browsers may not make any text formatting. Anyway, this tag can be useful with style sheets: it is possible to redefine its format, like what has been done here (words must be bold and yellow...). This tag is really not frequent.

<ACRONYM>

This tag highlights acronyms, that is to say words that are composed by initials (like abbreviations, but the word can be pronounced). Example: LASER, Light Amplification by Stimulated Emission of Radiation.

Like <ABBR>, acronyms on this page should appear in yellow and bold, but this may not work at all (this depends on your web browser).

<Address>

Highlights the author's address. The web browser usually inserts a line break. Example:

Sylvain BAUDOIN, sylvain_baudoin@themanualpage.org

<B>

Writes the embraced text in bold. Example: bold text.

<BIG> and <SMALL>

<BIG> writes text bigger than the normal size. On the contrary, <SMALL> writes text smaller. Example: SMALL size, normal size and BIG size.

<BLOCKQUOTE> and <Q>

These tags must be used for quotations. <BLOCKQUOTE> is used for long quotations where the text must be put in a new paragraph (with margins), and <Q> is used for short in-line quotations. <Q> should add quotes. Examples:

with <BLOCKQUOTE>:

I'm not against the police; I'm just afraid of them. (Alfred Hitchcock)

with <Q> : he rushed in, and said: hands up! It's a burglary!

<CITE>

This tag must be used to highlight the name of the author, or a reference. Example: Moby Dick, Herman Melville.

<CODE>

This tag must be used when writting code (program lines) in an HTML page. Here is the result:


shared-network FOO-BAR {
	filename "boot";

	subnet 192.168.2.0 netmask 255.255.255.224 {
		range 192.168.2.10 192.168.2.30;
	}

	subnet 192.168.2.32 netmask 255.255.255.224 {
		range 192.168.2.40 192.168.2.50;
	}
}

This tag may be shrewdly used with <PRE> (like in the example above) simply to cut and past code samples in HTML pages in order to keep the page setting.

<DEL> and <INS>

These tags highlight new things, but not new sections of the HTML page, they highlight new prices for instance: nails pass from $5 to $10 per kilo:

     nails                        $5 $10 per Kg

<DFN>

This tag is used to highlight definitions, instances' declarations... when putting code samples in an HTML page:


int max(int, int);

void main() {
    int i;

    printf("hello\n");
...
}

<EM>

Simply used to emphasis any text section: bla bla bla bla this section is very important bla bla bla bla bla bla bla.

<I>

Writes text in italic format.

<KBD>

Used to point out to the user a text he must enter in a field. Example: at the prompt, type "dir" to get the list of the files contained in the current directory.

<S> and <STRIKE>

They both Strike through text.

Deprecated tagWARNING! These tags are deprecated. It is recommended to use <SPAN STYLE="text-decoration: line-through;">text</SPAN> instead (thnaks to style sheets).

<SAMP>

Is used when quoting a code sample: printf("C is fun");...

<STRONG>

Like <EM>, emphasises a section of text, but in a stronger way. Example: with <EM>, with <STRONG>.

<SUB> and <SUP>

They respectively display text as subscript and superscript.

<TT>

Displays text in TeleType style.

<U>

This tag underlines text.

Deprecated tagWARNING! This tag is deprecated. It is adviced to use <SPAN STYLE="text-decoration: underline;">text</SPAN> instead (style sheets).

<VAR>

Must be used when refering to a function variable or parameter. Example: in this function, foo stands for bar.

Additional attributes

All these tags work fine without any special attribute. However, HTML4 has defined some:

  • id,
  • class,
  • lang,
  • title,
  • style.

as well as the following events:

  • onclick,
  • ondbclick,
  • onmouseover,
  • onmouseup,
  • onmousedown,
  • onmousemove,
  • onmouseout,
  • onkeypress,
  • onkeydown,
  • onkeyup.

printable format printable format



Copyright © 2000-2002 themanualpage.org - This site is submissive to the terms of the GNU GPL and FDL licences.