HTML text formatting (part 2)
This is part 2 of our three tutorials on text formatting.
This tutorial focuses on:
- Definition lists
- Deleted and inserted text
- Superscripts and subscripts
- Creating spaces
A definition list is a list of words together with their definitions organized in a certain manner. Definition lists are created using a few tags.
- A spikey plant
- A markup language for the web
NOTE: Bold the terms in a definition list to set them apart from the definitions.
Deleted and inserted text
Deleted and inserted text is displayed with the <del> and <ins> tags.
Long quotations are displayed with the <blockquote> tag. Short quotations are displayed with the <q> tag.
With the <q> tag, the browser will automatically display quote marks around the text. With the <blockquote> tag you have to put them yourself.
"Just as treasures are uncovered from the earth, so virtue appears from good deeds, and wisdom appears from a pure and peaceful mind. To walk safely through the maze of human life, one needs the light of wisdom and the guidance of virtue"
The only reward of virtue is virtue; the only way to have a friend is to be one
Superscripts and subscripts
Superscripts are created with the <sup> tag.
Subcripts are created with the <sub> tag.
Browsers ignore anything more than one consecutive space. The solution to this is the character entity. Every time you insert this character entity into your code, it will create one space.
Lists are an excellent way to present information in an organized fashion. There are three types of lists - numbered (ordered) lists, bulleted (unordered) lists, and definition lists (discussed at the beginning of this tutorial).
The bulleted list is a list which includes a bullet next to each item in a list. Bulleted lists are created with the <ul> tag. Each item in the list is displayed with the <li> tag.
Discs are the default bullet type in an unordered list, but you can set different bullet types with the type attribute of the <ul> tag.
The numbered list is a list which uses numbers instead of bullets next to each item in a list. Numbered lists are created with the <ol> tag. Each item in the list is displayed with the <li> tag.
You can set different bullet types with the type attribute of the <ol> tag.
Lists within lists
It is possible to implement lists within lists. Doing so presents information in a hierarchial fashion, and each level in the list can have a new type of bullet or number, or not.
- Big animals
- Small animals