SharePoint Information Site > Visual Guides > Basic HTML Guide

Basic HTML Guide

The purpose of this markup guide is to display the default settings for all possible HTML elements. This document ensures that no elements are missed and acts as a typographic style guide.

(The "Latin" text used on this page is called Lorem Ipsum. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the standard dummy text for over five centuries.)


First-Level Header / First-Level Header

The first-level header above is an h1 element. Conventionally, no more than one h1 should be used per page. Use an h1 as a header to specify the main subject of an entire Web page.

Second-Level Header / Second-Level Header

The secondary header above is an h2 element, which may be used for any form of important second-level header. More than one may be used per page. Consider using an h2 unless you need a header level of less importance or as a sub-header to an existing h2 element.

Third-Level Header / Third-Level Header

This is an h3 element, which may be used for any form of header below the h2 header in a document hierarchy. More than one may be used per page.

Fourth-Level Header / Fourth-Level Header

For all headers below third-level, follow the guidelines listed above. Only use lower header levels when necessary.

Fifth-Level Header / Fifth-Level Header

For all headers below third-level, follow the guidelines listed above. Only use lower header levels when necessary.


Paragraphs

Naturally paragraphs are wrapped in p tags. Additionally, p elements can be wrapped with a blockquote element if the p element is indeed a quote. blockquote is intended for use with quotes. Here's an example of its correct usage:

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras euismod fringilla arcu. Integer posuere. Aliquam ipsum. Donec eget massa ac orci tempus euismod. Donec quis neque nec neque consequat sollicitudin. Donec commodo tempor nulla. Suspendisse venenatis. Ut ut leo. Nunc placerat urna at libero. Nunc suscipit lacus.

lipsum.com

Additionally, you might wish to cite the source, as in the above example. (The correct method involves the cite attribute directly applied to the blockquote element, but since no browser makes any use of that information whatsoever, it's useful to also specify the standalone cite element.)


Inline Text

You might have noticed all the monospaced text in this guide. There are a number of inline HTML elements you may use anywhere within other elements, including abbr, cite, code, del, em, ins, kbd, strong, and var.

abbr
Used for any abbreviated text, whether it be acronym, initialism, or otherwise. Generally, it's less work and useful (enough) to mark up only the first occurrence of any particular abbreviation on a page, and ignore the rest. Any text in the title attribute will appear when the user's mouse hovers the abbreviation. Example abbreviations and usage: NASA, HTML, and Mass.
code

Used for computer code samples. Useful for technology-oriented sites, not so useful otherwise. Example code and usage:

function getJello() {
            echo $aDeliciousSnack;
        }

Inline usage: just like elsewhere in this document, HTML elements like em or code can be considered code, and marked up as such.

cite
Used for defining a citation or reference to other information sources. Example cited text and usage: More information can be found in [ISO-0000]
del
Used for deleted or retracted text which still must remain on the page for some reason. Since the default style includes a strikethrough line, it's preferable to the s element. The del element also has a datetime attribute which allows you to include a timestamp directly in the element. Example deleted text and usage: She bought two five pairs of shoes.
em
Used for denoting emphasized text. In most instances where you'd want to italicize text (using the HTML element i or otherwise) you should use the em element instead. Notable exceptions are stylistic italicizing of proper titles, foreign languages, etc. where italicizing is used for differentiation instead of emphasis. In those cases, no proper HTML elements exist, so an i element or a span element with a custom class may be preferable. Example emphasized text and usage: You simply must try the negitoro maki!
ins
Used for inserted text and counterpart to the del element. Like del, ins has a datetime attribute which allows you to include a timestamp directly in the element. Example inserted text and usage: She bought two five pairs of shoes.
kbd
Used for text which should be typed by the user. Mainly useful for computer instructions. Example keyboard text and usage: Please press Enter to continue.
strong
Used for denoting stronger emphasis than the em element. In most instances where you'd want to bold text (using the HTML element b or otherwise) you should use the strong element instead. Notable exceptions are stylistic bolding of examples, first occurrences of names in an article, etc. where bolding is used for differentiation instead of emphasis. In those cases, no proper HTML elements exist, so b element or a span element with a custom class may be preferable. Example strong text and usage: Don't stick nails in the electrical outlet.
var
Used for variables within computer code snippets. Useful for technology-oriented sites, not so useful otherwise. Example code and usage: Add 5 to $result and recalculate.

Misc Stuff abbr, pre, code, sub, sup, etc.

Lorem superscript dolor subscript amet, consectetuer adipiscing elit. Nullam dignissim convallis est. Quisque aliquam. cite. Nunc iaculis suscipit dui. Nam sit amet sem. Aliquam libero nisi, imperdiet at, tincidunt nec, gravida vehicula, nisl. Praesent mattis, massa quis luctus fermentum, turpis mi volutpat justo, eu volutpat enim diam eget metus. Maecenas ornare tortor. Donec sed tellus eget sapien fringilla nonummy. NBA Mauris a ante. Suspendisse quam sem, consequat at, commodo vitae, feugiat in, nunc. Morbi imperdiet augue quis tellus. AVE


Lists

Then there are the lists. ul denotes an unordered list (ie. a list of loose items that don't require numbering, or a bulleted list). ol denotes an ordered list, and various numbering schemes are available through the CSS (including 1,2,3... a,b,c... i,ii,iii... and so on) - each item within the ul or ol tags.

Additionally, dl is another list type called a definition list. Instead of list items, the content of a dl consists of dt (Definition Term) and dd (Definition description) pairs. Though it may be called a "definition list", dl can apply to other scenarios where a parent/child relationship is applicable. For example, it may be used for marking up dialogues, with each dt naming a speaker, and each dd containing his or her words.

Unordered List

  • This is an unordered list.
  • It has several items.
  • Here's an LI with a UL inside...
    • Kid 1
    • Kid 2
    • Kid 3
  • Here's an LI with a OL inside...
    1. Kid 1
    2. Kid 2
    3. Kid 3
  • and scene.

Ordered list

  1. This is an ordered list.
  2. It has several items.
  3. Here's an LI with a UL inside...
    • Kid 1
    • Kid 2
    • Kid 3
  4. Here's an LI with a OL inside...
    1. Kid 1
    2. Kid 2
    3. Kid 3
  5. and scene.

Definition List

This is a term.
This is the definition of that term, which both live in a dl.
Here is another term.
And it gets a definition too, which is this line.
Here is term that shares a definition with the term below.
Here is a defined term.
dt terms may stand on their own without an accompanying dd, but in that case they share descriptions with the next available dt. You may not have a dd without a parent dt.

Responsive, Multi-column List

  • Praesent vitae ligula nec orci
  • Sed accumsan quam ac tellus
  • Quam ac tellus
  • Donec eros
  • Vestibulum interdum magna sed quam
  • Quisque venenatis ante sit amet dolor
  • Nulla porta tempus sapien
  • Vestibulum interdum magna sed quam
  • Sed accumsan quam ac tellus
  • Fusce luctus convallis justo
  • Etiam eu ante non leo
  • Vestibulum interdum magna sed quam
  • Vivamus convallis urna id felis
  • Lorem ipsum dolor sit amet, consectetuer adipiscing elit
  • Orci tincidunt fermentum
  • Sed accumsan quam ac tellus
  • Donec id eros eget quam aliquam gravida
  • Lorem ipsum dolor sit amet, consectetuer adipiscing elit
  • Eros eget quam aliquam gravida
  • Etiam eu ante non leo egestas nonummy
  • Donec id eros eget quam aliquam gravida
  • Curabitur quis dui sit amet elit luctus aliquam
  • Cras aliquam massa ullamcorper sapien
  • Lorem ipsum dolor sit amet, consectetuer adipiscing elit
  • Praesent posuere nunc at neque blandit pretium