UH Hilo 2019—Pattern Library
See the UH Hilo Website Style Guide for proper usage of the below patterns.
Contents
Sections Linked
The main page header of this guide is an h1
element in a heading
class div. Any header elements may include links, as depicted in the example.
The secondary header above is an h2
element, which may be used for any form of important page-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 Linked
The header above is an h3
element, which may be used for any form of page-level header which falls below the h2
header in a document hierarchy.
Fourth-Level Header Linked
The header above is an h4
element, which may be used for any form of page-level header which falls below the h3
header in a document hierarchy.
Fifth-Level Header Linked
The header above is an h5
element, which may be used for any form of page-level header which falls below the h4
header in a document hierarchy.
Sixth-Level Header Linked
The header above is an h6
element, which may be used for any form of page-level header which falls below the h5
header in a document hierarchy.
Grouping content
Paragraphs
All paragraphs are wrapped in p
tags. Additionally, p
elements can be wrapped with a blockquote
element if the p
element is indeed a quote. Historically, blockquote
has been used purely to force indents, but this is now achieved using CSS. Reserve blockquote
for quotes.
Horizontal rule
The hr
element represents a paragraph-level thematic break, e.g. a scene change in a story, or a transition to another topic within a section of a reference book. The following extract from Pandora’s Star by Peter F. Hamilton shows two paragraphs that precede a scene change and the paragraph that follows it:
Dudley was ninety-two, in his second life, and fast approaching time for another rejuvenation. Despite his body having the physical age of a standard fifty-year-old, the prospect of a long degrading campaign within academia was one he regarded with dread. For a supposedly advanced civilization, the Intersolar Commonwearth could be appallingly backward at times, not to mention cruel.
Maybe it won’t be that bad, he told himself. The lie was comforting enough to get him through the rest of the night’s shift.
The Carlton AllLander drove Dudley home just after dawn. Like the astronomer, the vehicle was old and worn, but perfectly capable of doing its job. It had a cheap diesel engine, common enough on a semi-frontier world like Gralmond, although its drive array was a thoroughly modern photoneural processor. With its high suspension and deep-tread tyres it could plough along the dirt track to the observatory in all weather and seasons, including the metre-deep snow of Gralmond’s winters.
Pre-formatted text
The pre
element represents a block of pre-formatted text, in which structure is represented by typographic conventions rather than by elements. Such examples are an e-mail (with paragraphs indicated by blank lines, lists indicated by lines prefixed with a bullet), fragments of computer code (with structure indicated according to the conventions of that language) or displaying ASCII art. Here’s an example showing the printable characters of ASCII:
! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~
Blockquotes
The blockquote
element represents a section that is being quoted from another source.
Many forms of Government have been tried, and will be tried in this world of sin and woe. No one pretends that democracy is perfect or all-wise. Indeed, it has been said that democracy is the worst form of government except all those other forms that have been tried from time to time.
Ordered list
The ol
element 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 requires a surrounding <li>
and </li>
tag, to denote individual items within the list (as you may have guessed, li
stands for list item).
- This is an ordered list.
-
This is the second item, which contains a sub list
- This is the sub list, which is also ordered.
- It has two items.
- This is the final item on this list.
Unordered list
The ul
element denotes an unordered list (ie. a list of loose items that don’t require numbering, or a bulleted list). Again, each item requires a surrounding <li>
and </li>
tag, to denote individual items. Here is an example list showing the constituent parts of the British Isles:
-
United Kingdom of Great Britain and Northern Ireland:
- England
- Scotland
- Wales
- Northern Ireland
- Republic of Ireland
- Isle of Man
-
Channel Islands:
- Bailiwick of Guernsey
- Bailiwick of Jersey
Sometimes we may want each list item to contain block elements, typically a paragraph or two.
-
The British Isles is an archipelago consisting of the two large islands of Great Britain and Ireland, and many smaller surrounding islands.
-
Great Britain is the largest island of the archipelago. Ireland is the second largest island of the archipelago and lies directly to the west of Great Britain.
-
The full list of islands in the British Isles includes over 1,000 islands, of which 51 have an area larger than 20 km2.
Definition list
The dl
element is for another type of list 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.
- 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 accompanyingdd
, but in that case they share descriptions with the next availabledt
. You may not have add
without a parentdt
.
Figures
Figures are usually used to refer to images:
Here, a part of a poem is marked up using figure:
When you wish to cite the source of a quote, you should do so using a figure also:
Text-level Semantics
There are a number of inline HTML elements you may use anywhere within other elements.
Links and anchors
The a
element is used to hyperlink text, be that to another page, a named fragment on the current page or any other location on the web. Example:
Stressed emphasis
The em
element is used to denote text with stressed emphasis, i.e., something you’d pronounce differently. Where italicizing is required for stylistic differentiation, the i
element may be preferable. Example:
You simply must try the negitoro maki!
Strong importance
The strong
element is used to denote text with strong importance. Where bolding is used for stylistic differentiation, the b
element may be preferable. Example:
Don’t stick nails in the electrical outlet.
Underline
The u
element should not be used in all but a few rare cases. The Web has taught us that underlined text is a link and can be interacted with, even if the site design does not underline its links. Instead of underlining, use strong
and/or em
styling.
Abbreviation
The abbr
element is 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 (although notably, this does not work in Internet Explorer for Windows). Example abbreviations:
UH, HTML, and Vuls.
Time
The time
element is used to represent either a time on a 24 hour clock, or a precise date in the proleptic Gregorian calendar, optionally with a time and a time-zone offset. Example:
Queen Elizabeth II was proclaimed sovereign of each of the Commonwealth realms on and , after the death of her father, King George VI.
Superscript and subscript text
The sup
element represents a superscript and the sub element represents a sub
. These elements must be used only to mark up typographical conventions with specific meanings, not for typographical presentation. As a guide, only use these elements if their absence would change the meaning of the content. Example:
The coordinate of the ith point is (xi, yi). For example, the 10th point has coordinate (x10, y10).
f(x, n) = log4xn
Italicised
The i
element is used for text in an alternate voice or mood, or otherwise offset from the normal prose. Examples include taxonomic designations, technical terms, idiomatic phrases from another language, the name of a ship or other spans of text whose typographic presentation is typically italicised. Example:
There is a certain je ne sais quoi in the air.
Welcome to our ʻohana (family).
Coquí frogs, eleutherodactylus coqui, were accidentally introduced to Hawaiʻi around 1988.
Edits
The del
element is used to represent deleted or retracted text which still must remain on the page for some reason. Meanwhile its counterpart, the ins
element, is used to represent inserted text. Both del
and ins
have 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.
Tabular data
Tables should be used when displaying tabular data. The thead
, tfoot
and tbody
elements enable you to group rows within each a table.
If you use these elements, you must use every element. They should appear in this order: thead
, tfoot
and tbody
, so that browsers can render the foot before receiving all the data. You must use these tags within the table element.
Ingredients | Serves 12 | Serves 24 |
---|---|---|
Milk | 1 quart | 2 quart |
Cinnamon Sticks | 2 | 1 |
Vanilla Bean, Split | 1 | 2 |
Cloves | 5 | 10 |
Mace | 10 blades | 20 blades |
Egg Yolks | 12 | 24 |
Cups Sugar | 1 ½ cups | 3 cups |
Dark Rum | 1 ½ cups | 3 cups |
Brandy | 1 ½ cups | 3 cups |
Vanilla | 1 tbsp | 2 tbsp |
Half-and-half or Light Cream | 1 quart | 2 quart |
Freshly grated nutmeg to taste | ||
Total: | $12.00 | $15.00 |
Also see the UH Hilo Pattern Library below for more.
Forms
Buttons
Form Defaults
Also see the UH Hilo Pattern Library below for more.
UH Hilo Pattern Library
Notifications
Notice .notice
Notice error .notice.error
Notice info .notice.info
Notice success .notice.success
Notice warning .notice.warning
Notice div with paragraph inside.
Table Classes
Adding the list
class to the table provides additional formatting best suited for tabular data with columnar headings.
THEAD Col 1 | THEAD Col 2 |
---|---|
1, 1 | 1, 2 |
2, 1 | 2, 2 |
3, 1 | 3, 2 |
Adding the form
class to the table provides additional formatting best suited for tabular data with row headings.
Row 1: | 1, 2 |
---|---|
Another Row: | 2, 2 |
Row 3: | 3, 2 |
form.stacked
Columns/Grids
The .*-by
classes allow for responsive columns. Whole elements (such as a long list) should not be artifically separated just to get the list to show in multiple columns; this is an accessibility issue.
.two-by
.two-by
.three-by .info
.three-by .info
.three-by .info
.four-by .warning .padded
.four-by .warning .padded
.four-by .warning .padded
.four-by .warning .padded
.five-by .error
.five-by .error
.five-by .error
.five-by .error
.five-by .error
.six-by .success
.six-by .success
.six-by .success
.six-by .success
.six-by .success
.six-by .success
.two-by.info.padded
.two-by.info.padded .border
.two-by.dark.padded
.two-by.dark.padded .border
.two-by.light.padded
.two-by.light.padded .border
Tags
The .tags
class may be applied to an a
, button
, or span
.
Only Print
Content with the .only-print
class, such as this heading and text block, should only show when the page is being printed.