Ontario.ca web content editing guide
The web content editing guide helps content management system users create web pages with a consistent experience for those accessing ontario.ca.
About this guide
The web content editing guide is set up to help writers and web editors curate messaging and page layouts that are of a standard quality, easily recognized, accessible and consistent with the brand identity of ontario.ca, the Government of Ontario’s flagship website.
Ontario.ca style guide
How to write content for ontario.ca.
Ontario Design System
Create accessible and user-focused digital products and services consistent with the Ontario brand.
Working with HTML
Do not use a word processor such as Microsoft Word. Try Sublime Text or Notepad++ or a text editor of your choice. If you can’t install software on your work computer, try using a portable version of Sublime Text or portable Notepad++ which can run without being installed.
Most text editors can:
- save work-in-progress
- format and indent HTML and CSS
- autocorrect some errors
- colour code HTML for easier reading
Ontario.ca uses Drupal for content management and has a WYSIWYG code editor. However, we recommend that you write and edit HTML in a text editor first and then copy it to ontario.ca’s content management system.
Quality assurance
Manually check that the code and content have no errors and that links are working before publishing.
Check that you are using the correct tags and formatting by reviewing the design guide.
Learn more at Ontario.ca: checking your work and quality assurance (QA) (InsideOPS internal link).
Validator
Copy and paste your HTML into the W3C HTML validator. You can’t validate ontario.ca HTML by URL because the content is generated by JavaScript. Instead, use Validate by Direct Input
and select Validate HTML fragment.
Select the “Check” button.
On ontario.ca content, you will get errors or warnings if you use the <onesite>
custom elements. Skip those and address the other problems.
HTML guidelines
Follow standard HTML styles and conventions for tidy and consistent code. For example:
- use lowercase tag names
- Do:
<p>
- Do not:
<P>
- Do:
- use quotation marks around attributes
- Do:
<span lang="en">
- Do not:
<span lang=en>
- Do:
- include an end tag for all elements that are not listed below
- Do:
<p>This is a sentence.</p>
- Do not:
<p>This is a sentence.
- Do:
Do not use certain HTML elements and attributes, and CSS classes listed with "do not use" in the following list.
HTML elements used on ontario.ca
a
abbr
acronym
— do not useaside
b
— do not useblockquote
br
caption
cite
dd
div
dl
dt
em
— do not usefigcaption
figure
h1
— do not useh2
,h3
,h4
,h5
,h6
hr
i
iframe
img
li
ol
onesite-datatable
onesite-fax
onesite-phone
onesite-ref
p
q
small
span
strong
sub
sup
table
tbody
td
tfoot
th
thead
tr
u
— do not useul
HTML attributes
allowfullscreen
— foriframe
onlyalt
— forimg
onlybullet-colour
— forol.fancy
onlyclass
— can use anywheredir
— can use anywhereextension
— foronesite-phone
onlyframeborder
— foriframe
onlyheaders
— forth and td
onlyheight
— forimg
onlyhref
— fora
onlyhreflang
— fora
onlyicon
— foronesite-phone
andonesite-fax
onlyid
— can use anywhere buth2
label
— foronesite-phone
andonesite-fax
onlylang
— can use anywherescope
— forth
onlysrc
— forimg
andiframe
onlysummary
— avoid; fortable
tollfree
— foronesite-phone
onlytty
— foronesite-phone
onlytype
width
— forimg
only
Ontario.ca custom HTML
Ontario.ca has custom HTML elements and attributes. They are converted into valid HTML when displayed in a browser.
All of these elements begin with <onesite->
. For example, <onesite-ref>
for footnotes. Custom HTML elements generate errors when you validate HTML, but they can be used on ontario.ca.
CSS classes
alert
button
callout
columns
columns-x-large
,columns-large
,columns-medium
,columns-small
,columns-x-small
end
fancy
full-width
icon-name
img-round
inline-list
large
large-#
left
legal-list
legal-list-parentheses
medium-#
medium-up-left
,medium-up-right
no-bullet
no-stripes
no-wrap
non-numeric
not-legal
numeric
org-chart
parentheses
,parentheses-right
redacted
right
row
show-for-sr
small
small-#
smaller
secondary
summary
text-left
,text-right
,text-center
upper
uppercase
w-#
Abbreviations
Abbreviations are used to shorten lengthy terms. The <abbr>
tag assures that the meanings of acronyms and abbreviations are clear to everyone. Use abbreviations sparingly.
Acronyms and initialisms are also considered abbreviations and are treated the same. The <acronym>
tag is deprecated in HTML5.
Learn about abbreviations in the style guide.
ONTERM and Termium are great resources for many of the abbreviations used in the government.
Do and do not
Do
- use the
<abbr>
tag alongside the full version for the first time the abbreviation is used on a page, without the title attribute - use
<abbr title="">
</abbr>
every time after the first time - use tags around whole words
- Do:
<abbr title="Chief Executive Officers">CEOs</abbr>
- Do not:
<abbr title="Chief Executive Officers">CEO</abbr>s
- Do:
Do not
- use an abbreviation on a French page if there is no French equivalent (write out the full French word, even if the abbreviated version is used on the English page)
- introduce acronyms/abbreviations if you only use them one time (write out the full word)
- use
<abbr>
tags for abbreviations that are now used as words or abbreviations that are well-known and spoken as written - use Title Case for the title attribute unless it is a proper noun
Accessibility
Screen readers do not recognize acronyms and abbreviations unless they are defined with markup. For example, a screen reader may say “The it manager” in the sentence “The IT manager has arrived,” instead of “The eye-tee manager.”
First time use
Use <abbr>
alongside the full version for the first time, without the title attribute.
Subsequent use
After defining the abbreviation for the first time, use with the title attribute for every instance after.
Inside HTML tags
Abbreviations can be used as an inline element, meaning that it can be used within other codes.
Whole words
Always use the <abbr>
tag around the whole word.
Plurals
When the abbreviation is a root word
Symbols
Use the appropriate character or HTML entities instead of abbreviations. Refer to the list of official list of character entities.
- if it’s a minus sign in an equation, use − or
−
- if it’s an en dash, use – or
–
- if it’s a multiplication, use × or
×
Common abbreviations
Find more commonly used abbreviations by the Ontario Government.
English | French |
---|---|
e.g.
|
p. ex.
|
etc.
|
etc.
|
vs.
|
c.
|
et al.
|
et autres |
Inc.
|
Inc.
|
Ltd.
|
Ltée.
|
Other abbreviations
Related: Ontario Ministry acronyms
English | French |
---|---|
GO Transit
|
GO Transit
|
HTML
|
HTML
|
ISSN
|
ISSN
|
I&IT
|
ITI
|
LGBTQ+
|
LGBTQ+
|
ONTERM
|
ONTERM
|
OSAP
|
RAFEO
|
PDF
|
PDF
|
Units
Units are written without periods and are the same form for both singular and plural. Refer to numbers.
English | French |
---|---|
kg
|
kg
|
cm
|
cm
|
km2
|
km2
|
cm3
|
cm3
|
°C
|
°C
|
Legal terms
Laws, acts, regulations and the names of other documents, such as the Budget or Fall Economic Statement, must use the <cite>
tag. Do not use the <i>
or <em>
tag. Refer to italics.
Related: Titles of Ontario Public Service Corporate Directives, Operating Policies and Guidelines
Roman numerals
Do not use roman numerals unless they are legally required or used to refer to parts of other web pages or documents. Add abbreviation tags to roman numerals. Refer to numbers and roman-numeral ordered list.
When not to abbreviate words
Words that were previously abbreviations or acronyms that have been used so much that they become words themselves do not need to be abbreviated.
- fax
- scuba
- laser
- radar
- gym
- phone
- photo
Abbreviations that are well-known and spoken as written.
- i.e.
- RSVP
- ASAP
- a.m.
- p.m.
Charts, graphs and infographics
Charts and graphs
Charts are used to present data visually. Use a chart when the comparisons between values and data trends are more important to the user than the individual numeric values.
Do and do not
Do
- add a caption that describes the value comparisons and trends or add a table of the data below the chart
- use text and colours that have enough contrast
- use at least 12pt font for chart and graph labels
- label the axes of a chart or graph
- check that charts are readable in mobile devices (or resize your browser)
Do not
- use an image of a chart or graph if it can be built using HTML and CSS (learn more at infographics)
- use images of tables — build a table instead
- use text that has been rotated to display vertically instead of horizontally (it’s hard to read)
Accessibility
Accessible HTML graphs do not require alt text. If your graph is an image, write a detailed caption that conveys the same information a sighted user would have.
Alternative text isn’t sufficient for complex charts. Every browser has a limit to how many characters of alt text it will display. Avoid alt text longer than 125 characters as it may get cut off. Use figure captions to display longer text.
Use different line styles and weights, different shades of light and dark or different textures, in addition to colour, to differentiate data series and improve accessibility for colour blind users. Charts and graphs should be understandable if printed in black and white.
Learn more at Complex Graphics and Long Text Descriptions (InsideOPS internal link).
Organizational charts
Images of organizational charts are not accessible, they create barriers for those using a screen reader. They are also hard to read for those that have low vision or are using a mobile device.
Instead of using an image, create a simple unordered list with the class .org-chart
and include nested sub-lists to show the hierarchy of your organization. Wrap each list item with a <div></div>
tag to apply the styling. Link to the original image as a "printer friendly" version.
Below is a version of organizational chart for the fictional Ministry of Chocolate. The chart shows the following hierarchical structure with the top level assigned to the Minister of Chocolate.
Bar graph
Construct bar graphs row by row. Each bar can have a maximum width of 100%.
If you wanted to display the following data:
- 2,000
- 3,500
- 560
Use the highest value (3,500) as your 100% and calculate the other values from that. An online percentage calculator can help. To change the size of each bar, adjust the span class="amount w-##"
to the appropriate percentage.
Your bar chart row values will be:
w-57
w-100
w-16
You will put the actual values inside the span class="number"
The following example aligns the description to the right of the graph.
Stacked bar graph
Adding another span class="amount w-##"
will stack another bar on top of a bar.
The following example is a stacked bar graph with descriptions aligned to the left.
Infographics
An infographic combines information and graphics to present content in a visually interesting way. They combine text with images and sometimes charts or graphs — often in one large graphic.
The purpose of an infographic is important when deciding how to present it online. Infographics may be used for marketing as “shareables,” which are suitable for posting on social media.
If the infographic is intended to supplement the web content, it must be created as accessible mobile-friendly HTML and CSS. These are time consuming to make and must be supported by a government or marketing priority and approved by the Cabinet Office Digital if they will be posted on ontario.ca.
Do and do not
Do
- distribute shareables through social channels only
- link to printable infographics using the text “Download printer-friendly <title of document> (PDF)” instead of embedding them on the page
- describe printable infographics using a text alternative of the information contained in the infographic
Do not
- insert full size infographics onto a page — they are not accessible or mobile friendly
Contact information
Do and do not
Do
- use contact icons only on landing pages and place the icons before the phone and fax numbers, email address, social media accounts, and website addresses
Do not
- use icons if the contact information spans more than one line with the icon
- link to non-government social media accounts
Phone and fax numbers
On ontario.ca, use our custom HTML element for these numbers. Use the same code for French, and it will appear correctly when viewed on French pages.
The formatting you use will be ignored and replaced with standard formatting automatically. You can include letters in the number; it will show in both letter and number form. Use the extension attribute for extensions.
Phone numbers
Fax numbers
Multiple numbers
Icon and labels
Email addresses
If there is a single email address to contact for everything on a page, do not include the address on the page. Instead, use the contact link in the footer.
Addresses
Avoid abbreviations.
Highlight organization name
The heading level will need to be adjusted to fit your context.
Websites
Related: linking
Social media
Do and do not
Do
- link to official government social media accounts that are actively maintained (for example, a ministry’s account, a government marketing campaign, etc.)
- place social media links before other contact information
Do not
- link to more than one social media account of the same type per service (for example, do not link to two different Twitter/X accounts)
Combining contact information
Hours of operation
Include all days of the week. You may group days that have the same hours if they are consecutive.
Content highlighting
Asides and callouts
Do and do not
Do
- keep text brief and aim for a maximum of 280 characters
- minimize the use of callouts and asides — avoid having multiple per page if possible
Do not
- use asides to change the background colour of text — they have a semantic meaning
- use asides to highlight important content (refer to page alerts)
- put an entire block of content (rather than a short excerpt) in a callout or aside
Asides
Asides should include content that is not directly related to surrounding content on the page. Content in an aside could be considered separate from the rest of the page content. Asides are coded differently from callouts so they do not interrupt the flow of content for screen readers.
You can use asides when the content:
- can be skipped over without affecting the natural flow of the rest of the content
- is policy-related or niche information for stakeholder audiences
Use blockquotes if the content is quoted from another source and is still part of the main content.
Adjust the heading level to fit your content.
Callouts
A callout is used to emphasize an important snippet of information within the flow of a page. Content in a callout should be something on the page that you want to highlight, but that is not critical information.
Use blockquotes for quoted content or asides for content that is less important than the main content or task and do not need to be highlighted.
You can use a callout:
- to highlight interactive content such as a form, a search field or a calculator
- in the related links sidebar or in the body
- within infographics
Adjust the heading level to fit your content.
Example
This is a paragraph before the callout.
This is a paragraph after the callout.
<p>This is a paragraph before the callout.</p>
<div class="callout">
<h2>Heading in a callout</h2>
<form>
<label for="name">
Name
<input type="text" id="name" class="input" />
</label>
</form>
<p>This is a paragraph inside the callout with a <a href="#">link</a> and an <a href="#"><abbr title="Ontario Student Assistance Program">OSAP</abbr></a> <abbr title="abbreviation">abbr</abbr> link.</p>
<button class="button">Submit</button>
</div>
<p>This is a paragraph after the callout.</p>
Page alerts
Page alerts contain time-sensitive pieces of information and typically appear at the top of a page to capture the user’s attention.
Use page alerts to:
- highlight content that notifies users about service interruptions and changes
- bring attention to safety warnings
- communicate the result of a user action (for example, error or success)
Do and do not
Do
- try to limit to one alert per page — users will start ignoring them if overused
- write concise headings and copy totalling a max of 280 characters
- include a heading that clearly convey the purpose of the alert (for example, “Warning”)
- adjust the heading level to fit your content
Do not
- use page alerts just for styling regular content (for emphasis or highlighting)
- include alerts that are not related to the user’s current goal
- blame the user when writing error messages (instead of “You entered an invalid postal code”, try “Please enter numbers and letters only”)
Examples
Information
Use information alerts for important time-sensitive information. For example, important dates, recent content updates, new policies or email confirmation.
<div class="alert alert--informational">
<div class="alert__header">
<div class="alert__header-icon">
<svg alt="" aria-hidden="true" class="icon" focusable="false" preserveaspectratio="xMidYMid meet" role="img" sol:category="primary" viewbox="0 0 24 24"><use xlink:href="#ontario-icon-alert-information"></use></svg>
</div>
<h2 class="alert__header-title h4">Information</h2>
</div>
<div class="alert__body">
<p>Use <strong>information alerts</strong> for important time-sensitive information. For example, important dates,
recent content updates, new policies or email confirmation.</p>
</div>
</div>
Warning
Warning alerts tell the user something urgent or help the user avoid a problem. For example, travel information, content trigger warnings or location closures.
<div class="alert alert--warning">
<div class="alert__header">
<div class="alert__header-icon">
<svg alt="" aria-hidden="true" class="icon" focusable="false" preserveaspectratio="xMidYMid meet" role="img" sol:category="primary" viewbox="0 0 24 24"><use xlink:href="#ontario-icon-alert-warning"></use></svg>
</div>
<h2 class="alert__header-title h4">Warning</h2>
</div>
<div class="alert__body">
<p><strong>Warning alerts</strong> tell the user something urgent or help the user avoid a problem. For example,
travel information, content trigger warnings or location closures.</p>
</div>
</div>
Archive labels
Archive labels are used for online content that is out of date or inaccurate, but needs to be kept online for research or archival purposes. Archived content should link to the current version of a document, if it exists.
On ontario.ca, ministry web contributors can use the Archive and other labels
tab to automatically show an archive label.
Content is not current
Content that has been replaced by more recent, relevant content.
Example
About the Pan Am/Parapan Am games
Page archived
This page is no longer current and is provided for archival and research purposes.
Content is not accurate
Content that is not accurate and could mislead the public if not labelled appropriately.
Example
Freedom of information and privacy manual
Page archived
This page is no longer accurate and is available for archival and research purposes.
Read the most recent information.
Previous government
Content that is from a previous government and doesn’t reflect the current government’s views, policies or communications. There is no associated pointing URL in this scenario.
Example
Developing Ontario’s Dementia Strategy: Discussion Paper
Page archived
This page was published under a previous government and is available for archival and research purposes.
Button links
Do and do not
Do
- ensure button text is clear, descriptive and action-oriented (for example, “Apply for OSAP” or “Download your receipt”)
- use sentence case (capitalize only the first letter of the first word)
- use a maximum of 25 characters including spaces
Do not
- change button colours
- underline text for primary or secondary buttons
- use multiple primary and secondary buttons unless absolutely necessary
You can use buttons to help the user carry out an important action such as downloading a PDF. Use a specific call-to-action rather than a generic one. For example: “Complete our survey” instead of “Share your feedback”.
Examples
Use a primary button to draw attention to the main action you want to help the user take. Avoid using multiple primary buttons on one page unless the page has equally important calls to action.
<div><a class="button button--primary" href="">Complete our survey</a></div>
Use a secondary button for a less important call to action on a page. Avoid using multiple secondary buttons so the user is not confused about what they should do next. Instead, ask the writer to simplify or break up the content so that it doesn’t need multiple secondary buttons.
<div><a class="button button--secondary" href="">Read the appendix</a></div>
Use tertiary buttons for links that should function like a button, such as “edit” or “cancel” in applications. It’s okay to use more than one tertiary button on a page.
<div><a class="button button--tertiary" href="">Cancel</a></div>
Images, maps and videos
In this section:
Images
Do and do not
Do
- use images to illustrate concrete things (for example, animals, I.D. cards, licence plate sticker), not abstract concepts (for example, light, holistic, synergy)
- use branding from the Ontario Visual Identity (approved logos and marketing campaign graphics) and approved Ontario brands (for example, ServiceOntario)
- use images to illustrate the hierarchy of content by using tall banners on entry pages (home pages, the landing page for a marketing campaign), narrow banners on top-level topic landing pages and no banners on sub-topic or article pages
- optimize images for the web to reduce the file size as much as possible while maintaining a reasonable quality (read Compressing image files in the design system)
Do not
- put text on images
- use images of text except for logos where preservation of the font face is critical, or for maps and charts — images of text create barriers for mobile device users and people with low vision
- use photographs to set the mood or decorate a page
- develop a new brand for a program or page — use the Ontario Visual Identity instead
- heavily-distort or edit images associated with the Ontario Visual Identity
- use images that are unrelated to the page’s subject matter
- use images that are too small to show important details, especially if viewed on mobile devices
Alt text and image accessibility
Images can make content easier to understand for those with cognitive and learning disabilities. It also serves as a visual cue for those with low vision. Inaccessible images can be a barrier to some people.
Consider inclusion and diversity when selecting photographs. Think about what age, gender, race, culture, religion, sexual orientation, abilities, family structure, income and location you are representing with your choices. Learn more about photography usage in the design system.
Images must have text alternatives (alt text) that describe the content of the image, unless purely decorative. In addition to alt text, check how your images appear to colour-blind users and in black and white.
Learn more at Complex Graphics and Long Text Descriptions (InsideOPS internal link).
When to add alt text
Alt text provides a text alternative to images, photography and other non-text content.
If an image is decorative and provides no added information, the alt
attribute should be blank. One way to determine if an image is decorative is to write the alt text, and then see if the alt text adds any extra value for the user.
Examples of alt text:
- alt text that adds value:
the Minister of Health shakes hands with a conference attendee
- alt text that adds no value: “blue square” (the image is decorative)
Visit WebAIM for more examples.
When writing alt text
Do
- be accurate when describing the image
- write what’s needed to cover the information and meaning that the image provides
- describe the function, content and context of the image
- include details that are important to the page’s narrative and subject matter
- keep it short — a short sentence is often enough, but if needed, keep it to a maximum of two sentences
- limit the text to 125 characters as every browser has a different alt text character length limit (this also accounts for the fact that the French translation will typically be longer than the English)
- add a caption to your image if you cannot describe the image sufficiently with just alt text
Do not
- repeat information in the alt text if there’s content around the image that already offers the same information — this is redundant and adds informational “clutter” for assistive technology users
- use phrases like “image of …” or “graphic of …” — users will already know they are focused on an image element
Example

<img alt="Small fish with a red stripe along the front half of the body and a bright yellow stripe above that extends almost to the tail fin." src="https://www.ontario.ca/files/2024-01/mecp-sar-redside-dace-200x200.jpg">
Banners
Use a banner to add visual interest to the landing page for:
- your ministry
- a paid marketing campaign
- a key high-profile government initiative
Images must be:
- exactly 760×560px
- no more than 1 MB
- a PNG, JPG or JPEG
Do and do not
Do
- choose a single image (versus a multi-image panel) that represents an aspect, idea or interpretation of the page topic
- use an image that is impactful and focused
- ensure that the title and lead area that overlays the banner will not cover the primary subject matter, such as people’s faces.
- credit banner images if required by using a
<small>
tag in the summary or at the bottom of the page.
Do not
- add borders around banners — banners span the full width of the users screen
Examples
Thumbnails
Thumbnails are placed to the right of the title and lead of article pages. Thumbnails must be:
- a minimum width of 352px
- no more than 50 kb
- a PNG, JPG or JPEG
Try to match thumbnail images to the height of the lead. For example, on desktop, a page lead with:
- 1 to 2 lines, use a 16:9 image ratio or a 352×198px image
- 3 to 5 lines, use a 4:3 image ratio or a 352×264px image
- 6 lines or more, use a 1:1 image ratio or a 352×352px image
Include clear space inside the image boundary for official wordmarks and logos — otherwise the logo will stretch to the edge of the boundary.
Examples
16:9 image ratio
Floods
Be prepared: What you should do before, during and after a flood, and where to get current flood information.
Find Ontario Wood products
Search for sustainable, locally crafted Ontario Wood products.
Rabies in pets
How pets get rabies, what do to if your pet is exposed and what you need to know about the rabies vaccine.
4:3 image ratio
Renew, replace or change an accessible parking permit
If you have an existing accessible parking permit, you can renew, replace or change information on your permit.
What to know before buying a home
Learn how Ontario’s consumer laws protect homebuyers and sellers. Get information on choosing a real estate agent, buying a new or pre-construction home and hiring a home inspector.
Get a G driver’s licence: new drivers
If you are at least 16 years old, you can apply for driver’s licence in Ontario. As a new driver, you will need to practice driving and gain experience over time. For most people, the two-step process takes about 20 months to finish. Here’s how you get a driver’s licence.
1:1 image ratio
Wait times to see a specialist and for surgery
Understanding your wait time to see a specialist or get surgery can be complicated.
We’re here to help. Get information and advice about wait times in Ontario.
See wait times for surgeries and proceduresSee other wait times we track
Page body
Do and do not
Do
- use JPEG format for photographs
- use PNG for non-photographic images (icons, drawings)
- embed images that fit the page width
- use multiple images targeted for various screen sizes, if necessary
Do not
- embed images larger than 900px wide such as maps — instead, link to the image
- use images that aren’t recognizable when viewed on small screens
Examples
The Northern Map Turtle’s range extends from the Great Lakes region west to Oklahoma and Kansas, south to Louisiana and east to the Adirondack and Appalachian mountain barrier. There are isolated populations in New Jersey and New York states. In Canada, it is found in southwestern Quebec and southern Ontario. In southern Ontario, it lives primarily on the shores of Georgian Bay, Lake St. Clair, Lake Erie and Lake Ontario, and along larger rivers including the Thames, Grand and Ottawa.
Default image

<img alt="White bird with a long orange beak and black-tipped wings" src="https://www.ontario.ca/files/2024-01/mecp-sar-american-white-pelican-400x400.jpg" width="200" />
Circular image

Use a square image in order to get a perfect circle. You can use a width modifier class w-1
up to w-100
to adjust the width of an image in percentages.
<img alt="White bird with a long orange beak and black-tipped wings" class="img-round img-left" src="https://www.ontario.ca/files/2024-01/mecp-sar-american-white-pelican-400x400.jpg" width="200" />
<p>
Use a square image in order to get a perfect circle. You can use a width modifier class <code>w-1</code> up to <code>w-100</code> to adjust the width of an image in percentages.
</p>
Floats

In supported browsers, text will wrap around the image in a circular shape if the image uses the class .img-left
or .img-right
.
<img alt="White bird with a long orange beak and black-tipped wings" class="img-round img-right w-50" src="https://www.ontario.ca/files/2024-01/mecp-sar-american-white-pelican-400x400.jpg" />
<p>
In supported browsers, text will wrap around the image in a circular shape if the image uses the class <code>.img-left</code> or <code>.img-right</code>.
</p>
Clearing floats on small screens

If you do not want your content to wrap around your floated image on small screens, use the class .medium-up-right
or .medium-up-left
.
<img alt="" class="medium-up-left" src="https://www.ontario.ca/files/2024-01/mnrf-kayak-144x171.jpg" />
<p>
If you do not want your content to wrap around your floated image on small screens, use the class <code>.medium-up-right</code> or <code>.medium-up-left</code>.
</p>
Captions

<figure>
<img alt="White bird with a long orange beak and black-tipped wings" src="https://www.ontario.ca/files/2024-01/mecp-sar-american-white-pelican-400x400.jpg" width="200" />
<figcaption>
American pelican
</figcaption>
</figure>
Rounded image with a caption

<figure class="img-round">
<img alt="White bird with a long orange beak and black-tipped wings" class="w-50" src="https://www.ontario.ca/files/2024-01/mecp-sar-american-white-pelican-400x400.jpg" />
<figcaption>
American pelican
</figcaption>
</figure>
Image with a caption floated left

People across Ontario are coming together to celebrate the 10th anniversary of the Accessibility for Ontarians with Disabilities Act (AODA).
Thanks to this groundbreaking legislation, which was introduced in 2005, organizations and businesses have been removing barriers to make it easier for people with disabilities to participate in their workplaces and communities.
I’m excited by the progress we’re making. Standards related to information and communications, transportation, public spaces, customer service and employment have been taking effect for the last several years and will be fully rolled out by 2021.
<figure class="left">
<img alt="White bird with a long orange beak and black-tipped wings" src="https://www.ontario.ca/files/2024-01/mecp-sar-american-white-pelican-400x400.jpg" width="200" />
<figcaption>
American pelican
</figcaption>
</figure>
<p>
People across Ontario are coming together to celebrate the 10<sup>th</sup> anniversary of the <cite>Accessibility for Ontarians with Disabilities Act</cite> (<abbr>AODA</abbr>).
</p>
<p>
Thanks to this groundbreaking legislation, which was introduced in 2005, organizations and businesses have been removing barriers to make it easier for people with disabilities to participate in their workplaces and communities.
</p>
<p>
I’m excited by the progress we’re making. Standards related to information and communications, transportation, public spaces, customer service and employment have been taking effect for the last several years and will be fully rolled out by 2021.
</p>
Image with a caption floated right

People across Ontario are coming together to celebrate the 10th anniversary of the Accessibility for Ontarians with Disabilities Act (AODA).
Thanks to this groundbreaking legislation, which was introduced in 2005, organizations and businesses have been removing barriers to make it easier for people with disabilities to participate in their workplaces and communities.
I’m excited by the progress we’re making. Standards related to information and communications, transportation, public spaces, customer service and employment have been taking effect for the last several years and will be fully rolled out by 2021.
<figure class="right">
<img alt="White bird with a long orange beak and black-tipped wings" src="https://www.ontario.ca/files/2024-01/mecp-sar-american-white-pelican-400x400.jpg" width="200" />
<figcaption>
American pelican
</figcaption>
</figure>
<p>
People across Ontario are coming together to celebrate the 10<sup>th</sup> anniversary of the <cite>Accessibility for Ontarians with Disabilities Act</cite> (<abbr>AODA</abbr>).
</p>
<p>
Thanks to this groundbreaking legislation, which was introduced in 2005, organizations and businesses have been removing barriers to make it easier for people with disabilities to participate in their workplaces and communities.
</p>
<p>
I’m excited by the progress we’re making. Standards related to information and communications, transportation, public spaces, customer service and employment have been taking effect for the last several years and will be fully rolled out by 2021.
</p>
Maps
Maps, even if they are images, should be brought to Cabinet Office Digital for approval because there are special accessibility and mobile considerations. We may recommend a map be presented in these formats:
- ArcGIS or ArcGIS Online map
- Text description and accessible PDF
All images of maps must have descriptive text that clearly describes the content, including:
- the data coordinates or addresses in a table below the map
- a description of what the map shows
- a description of any key boundaries
The size of the map embedded on the page cannot be wider than the body content area. You may link to a full-sized PDF version for print purposes.
Examples
Map accessibility
The descriptive text must be visible to all users and located above or below the map (or linked to from above or below the map).
Accessibility is inclusive of many assistive technologies and techniques used by people with disabilities, including screen readers, screen magnifiers, browser text contrast increases, zooming and more. Anyone with poor vision and/or colour blindness could benefit from a text description of a graphic.
Alt text is not sufficient for a map for two reasons:
- Every browser has a different alt text character length limit. We recommend up to 125 characters in alt text. This accounts for the fact that the French translation will typically be about 1/3 longer than the English. 125 characters is usually not sufficient to describe a map.
- Alt text is not always used by people with poor vision and colour blindness.
When linking to a larger version of the map, use a high-resolution PDF with vector shapes and text instead of a high-resolution image, because the PDF can be printed at a higher quality.
Videos
Videos can be useful to convey instructions or information to users, but can also be a barrier to some users if they aren’t made accessible.
Do and do not
Do
- use videos only if the content is easier to understand with moving images
- caption videos
- include both a transcript and audio description
Accessibility
Captions
Videos with audio require captions that are synchronized with the audio track. Everything said in the video must be included in the captions. It must also include names, sounds and descriptions.
There are two types of captions: open and closed. Open caption means that the caption is embedded into the video itself, and cannot be turned off. Closed captioning means that the caption can be turned on and off.
Audio description
Audio descriptions speak out what is happening in the video so that it’s accessible to people with low vision. There are two ways to create audio descriptions:
- a narrator describes all the visual information
- add a separate audio track that describes the visual information, where possible
Example
<div class="flex-video">
<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/kjRM8McFNGs?rel=0" width="560"></iframe>
</div>
<p>
<a href="http://media.ontarionewsroom.com/desctxt/summer-employment-opportunities-with-the-ontario-government.html">Descriptive transcript: 2016 summer employment opportunities with the Ontario Government</a>
</p>
Vertical videos
- Use class
flex-video--shorts
on videos that are vertical or 9:16. - Applying a grid will help determine what size it needs to be at in varying screen sizes.
Example
<div class="row">
<div class="columns small-12 medium-10">
<div class="flex-video flex-video--shorts">
<iframe allow="autoplay; encrypted-media" allowfullscreen="" frameborder="0" scrolling="no" src="https://www.youtube.com/embed/hhPBNwwacoY"></iframe>
</div>
</div>
</div>
<p>
<a href="http://media.ontarionewsroom.com/desctxt/ontario-pay-and-file.html">Descriptive transcript: Ontario Pay and File</a>
</p>
Languages
In this section:
Use the lang
attribute to declare changes in language on a page. This includes English text on French pages and vice versa.
Do and do not
Do
- declare the primary page language of each page
- use lowercase ISO 639-1 codes for the
lang
attribute unless one doesn’t exist (use the ISO 639-2 codes instead) - use
lang="XX"
in a<span>
,<div>
or<p>
element that contains text written in another language
Examples
What does <span lang="fr">je ne sais quoi</span> mean in English?
Les roses de Saadi
J’ai voulu ce matin te rapporter des roses ;
Mais j’en avais tant pris dans mes ceintures closes
Que les noeuds trop serrés n’ont pu les contenir.
Les noeuds ont éclaté. Les roses envolées
Dans le vent, à la mer s’en sont toutes allées.
Elles ont suivi l’eau pour ne plus revenir ;
La vague en a paru rouge et comme enflammée.
Ce soir, ma robe encore en est tout embaumée…
Respires-en sur moi l’odorant souvenir.
<div lang="fr">
<h4>Les roses de Saadi</h4>
<p>
J’ai voulu ce matin te rapporter des roses ;<br>
Mais j’en avais tant pris dans mes ceintures closes<br>
Que les noeuds trop serrés n’ont pu les contenir.
</p>
<p>
Les noeuds ont éclaté. Les roses envolées<br>
Dans le vent, à la mer s’en sont toutes allées.<br>
Elles ont suivi l’eau pour ne plus revenir ;
</p>
<p>
La vague en a paru rouge et comme enflammée.<br>
Ce soir, ma robe encore en est tout embaumée…<br>
Respires-en sur moi l’odorant souvenir.
</p>
<cite>Marceline Desbordes-Valmore</cite>
</div>
French characters
Name | Lowercase | Uppercase |
---|---|---|
a circumflex | â | Â |
a grave | à | À |
a acute | á | Á |
c cedilla | ç | Ç |
e acute | é | É |
e circumflex | ê | Ê |
e diaeresis | ë | Ë |
e grave | è | È |
Name | Lowercase | Uppercase |
---|---|---|
i circumflex | î | Î |
i diaeresis | ï | Ï |
o circumflex | ô | Ô |
u circumflex | û | Û |
u diaeresis | ü | Ü |
u grave | ù | Ù |
y diaeresis | ÿ | Ÿ |
English links on a French page
If there is no French version of the page, set the lang
and the hreflang
attributes since the text of the link is also in English.
Example
<a lang="en" hreflang="en" href="https://www.formulary.health.gov.on.ca/formulary/">Ontario Drug Benefit Formulary/Comparative Drug Index</a>
Non-breaking spaces
A non-breaking space (in HTML as
) prevents text from wrapping to a new line at that point. It is important to include non-breaking spaces rather than regular spaces in certain specific circumstances in French.
Quotation marks
These need non-breaking spaces after the opening mark and before the closing mark.
Le ministère a tenu une séance en personne du cours « appuyer les employés » pour aider les gestionnaires à recevoir la formation requise.
Colons
These should be preceded by a non-breaking space.
Vous devez vous rendre à un centre, si un des problèmes suivants s’applique à votre vignette d’immatriculation :
- renseignements erronés
- vignette perdue
<p>
Vous devez vous rendre à un centre, si un des problèmes suivants s’applique à votre vignette d’immatriculation :
</p>
<ul>
<li>renseignements erronés</li>
<li>vignette perdue</li>
</ul>
Dashes
Any dash (hyphen, en dash or em dash) that is preceded by a space should be using a non-breaking space.
Numbers, dates and times
The space after any digit (or fraction character) should be a non-breaking space, unless it is a year.
30 000 $
50 kilomètres
50 million
50 kilometres
If a month or season (or “de”) and a year are separated by only a space, that space should be a non-breaking space.
janvier 2018
January 2018
The “h” used to separate hours and minutes should also be followed by a non-breaking space.
8 h 30
8:30 a.m.
Other circumstances
There may be other circumstances in which non-breaking spaces should be used rather than regular ones to maintain readability. Read the text and think to yourself, “Would it be odd if the line of text wrapped at this spot?”.
un appareil électronique de communication (<abbr title="par exemple">p. ex.</abbr>, un téléphone cellulaire)
<abbr title="alinéa">al.</abbr> (7 (2) a), et <abbr title="paragraphe">par.</abbr> 12 (1), (2) et (3), et <abbr title="paragraphe">par.</abbr> 97 (1)
Non-breaking spaces tool
Link to multilingual versions of content
Use the name of the page or document in the language the content is in, followed by the language in English in brackets. This makes content accessible to two audiences:
- people with a lower understanding of English
- English speakers looking for alternative language content for other people (for example, children of elderly parents and health care workers)
Examples
This document is available in other languages:
<p>
This document is available in other languages:
</p>
<ul>
<li>
<a href="https://docs.ontario.ca/documents/3496/broch-po.pdf" hreflang="pt"><span lang="pt">Testes Pré-Natais para o <abbr title="vírus da imunodeficiência humana">VIH</abbr></span> (Portuguese <abbr title="Portable Document Format">PDF</abbr>)</a>
</li>
<li>
<a href="https://docs.ontario.ca/documents/3498/broch-sw.pdf" hreflang="sw"><span lang="sw">Mpango wa kupima ukimwi katika uja uzito</span> (Swahili <abbr title="Portable Document Format">PDF</abbr>)</a>
</li>
</ul>
Most common languages in Ontario
Language | Code | Right-to-left? | Autoglottonym |
---|---|---|---|
English | en | No | English |
French | fr | No | Français |
Mandarin | zh | No | 國語 |
Cantonese | yue | No | 廣東話 |
Punjabi | pa | No | ਪੰਜਾਬੀ |
Spanish | es | No | Español |
Arabic | ar | Yes | عربي |
Italian | it | No | Italiano |
Urdu | ur | Yes | اردو |
Filipino (Tagalog) | tl | No | Tagalog |
Portuguese | pt | No | Português |
Tamil | ta | No | தமிழ |
Polish | pl | No | Polski |
Russian | ru | No | Русский |
Farsi (Persian) | fa | Yes | فارسی |
Gujarati | gu | No | ગુજરાતી |
German | de | No | Deutsch |
Hindi | hi | No | हिन्दी |
Vietnamese | vi | No | Tiếng Việt |
Korean | ko | No | 한국어 |
First nations languages
None of these are written right-to-left.
Language | Code | Autoglottonym |
---|---|---|
Ojibway | oj (ISO 639‑1) | ᐊᓂᔑᓈᐯᒧᐎᓐ |
Cree | cr (ISO 639‑1) | ᓀᐦᐃᔭᐍᐏᐣ |
Oji-cree | ojs (ISO 639‑3) | ᐊᓂᔑᓂᓂᒧᐏᐣ |
Inuktitut | iu (ISO 639‑1) | ᐃᓄᒃᑎᑐᑦ |
Mohawk | moh (ISO 639‑3) | Kanien’kéha |
Swampy Cree | csw (ISO 639‑3) | ᓀᐦᐃᓇᐍᐏᐣ |
Ottawa (Odawa) | ctw (ISO 639‑3) | N/A |
Mi'kmaq | mic (ISO 639‑3) | Míkmawísimk |
Chinese languages
Cantonese and Mandarin are listed in the above table, as they are spoken languages. For writing systems, use this table:
Language | Code | Autoglottonym |
---|---|---|
Chinese (Traditional) | zh-TW | 中文 (繁體) |
Chinese (Simplified) | zh-CN | 中文 (简体) |
Layout
In this section:
Related: floating images
Alignment and wrapping
Use the .no-wrap
class to prevent text from being split across multiple lines. Changing how text wraps can have a significant impact on the layout on mobile devices. Learn how wrapping is used with French copy.
Do and do not
Do
- use
.no-wrap
sparingly, for 5 words or 20 digits or less - use centre and right alignment if necessary when building infographics and visualizations
Do not
- use the
.no-wrap
class or
for phone numbers, use phone number markup instead - use centre and right alignment for paragraphs and lists of content
Examples
This text is left-aligned, which is the default.
<p class="text-left">This text is left-aligned, which is the default.</p>
This text is right-aligned.
<p class="text-right">This text is right-aligned.</p>
This text is centred.
<p class="text-center">This text is centred.</p>
To prevent some text from being split across multiple lines, use the .no-wrap
class.
Example
The code is 123 456.
The code is <span class="no-wrap">123 456</span>.
You can also replace a space with a non-breaking space to prevent wrapping at that position.
Example
The code is 123 456.
The code is 123 456.
Margin and padding
Refer to the full description of margin and padding classes to help modify spacing within your layout.
Please note that all spacing classes have been modified for the ontario.ca theme. The Ontario Design System’s use of namespace ontario-
has been removed from each class name for ontario.ca. For example:
ontario-margin-top-0-!
has been changed tomargin-top-0-!
ontario-padding-top-0-!
has been changed topadding-top-0-!
Grids
Ontario.ca uses a modified version of Foundation’s grid system — a 12-column, nest-able grid. Start by adding a <div>
element with a class of .row
. This will create a horizontal block to contain vertical columns. Then add <div>
s with a .column
class within that row. Specify the widths of each column with the .small-#
, .medium-#
, and .large-#
classes. All columns must add up to 12 or the last column must use class .end
.
The Foundation grid is mobile-first. Code for small screens first, and larger devices will inherit those styles. Customize for larger screens as necessary.
If you use columns anywhere on an ontario.ca page, make sure all content in the body field is laid out in columns, otherwise the text will not align. Text inside columns will indent because of padding. Use a row with .small-12 .columns
for any content that is not part of the multi-column layout.
Learn more about grid column options in the design system.
Examples
One column
This section will span the whole page, i.e. a single column.
first column text
<div class="row">
<div class="columns small-12">
<p>first column text</p>
</div>
</div>
Two equal columns (responsive)
This changes to a single column on small screens.
first column text
second column text
<div class="row">
<div class="columns small-12 medium-6">
<p>first column text</p>
</div>
<div class="columns small-12 medium-6">
<p>second column text</p>
</div>
</div>
Two equal columns
This will be two columns on all screen sizes.
first column text
second column text
<div class="row">
<div class="columns small-6">
<p>first column text</p>
</div>
<div class="columns small-6">
<p>second column text</p>
</div>
</div>
Two columns: wide then narrow (responsive)
This changes to a single column on small screens.
first (wide) column
second (narrow) column
<div class="row">
<div class="columns small-12 medium-8">
<p>first (wide) column</p>
</div>
<div class="columns small-12 medium-4">
<p>second (narrow) column</p>
</div>
</div>
Two columns: narrow then wide (responsive)
This changes to a single column on small screens.
first (narrow) column
second (wide) column
<div class="row">
<div class="columns small-12 medium-4">
<p>first (narrow) column</p>
</div>
<div class="columns small-12 medium-8">
<p>second (wide) column</p>
</div>
</div>
Three equal columns (responsive)
This changes to a single column on small screens.
first column text
second column text
third column text
<div class="row">
<div class="columns small-12 medium-4">
<p>first column text</p>
</div>
<div class="columns small-12 medium-4">
<p>second column text</p>
</div>
<div class="columns small-12 medium-4 end">
<p>third column text</p>
</div>
</div>
Four equal columns (responsive)
This changes to a single column on small screens.
first column text
second column text
third column text
fourth column text
<div class="row">
<div class="columns small-12 medium-3">
<p>first column text</p>
</div>
<div class="columns small-12 medium-3">
<p>second column text</p>
</div>
<div class="columns small-12 medium-3">
<p>third column text</p>
</div>
<div class="columns small-12 medium-3 end">
<p>fourth column text</p>
</div>
</div>
Source ordering
Using these source ordering classes, you can shift columns around between our breakpoints.
Examples
Push pull — large screens
Large screen 1
Large screen 2
<div class="row">
<div class="columns large-9 large-push-3">
<p>Large screen 1</p>
</div>
<div class="columns large-3 large-pull-9">
<p>Large screen 2</p>
</div>
</div>
Push pull — medium screens
Medium screen 1
Medium screen 2
<div class="row">
<div class="columns medium-7 medium-push-5">
<p>Medium screen 1</p>
</div>
<div class="columns medium-5 medium-pull-7">
<p>Medium screen 2</p>
</div>
</div>
Push pull — small screens
Small screens 1
Small screen 2
<div class="row">
<div class="columns small-9 small-push-3">
<p>Small screens 1</p>
</div>
<div class="columns small-3 small-pull-9">
<p>Small screen 2</p>
</div>
</div>
Block grid
Block grids are a shorthand way to create equally-sized columns. Add a class of the format .[size]-up-[n]
to change the number of columns within the row. By default, the max number of columns you can use with block grid are 8.
Examples
Using content division div
Operations Director
Mrs. Bucket
Finance Director
Grandpa Joe
Legal Director
Mrs. Beauregarde
Chief Chocolate Taster
Mr. Teavee
Associate DM Marketing Board
Mrs. Gloop
<div class="row small-up-1 medium-up-2 large-up-3">
<div class="column">
<h3>Operations Director</h3>
<p><abbr title="Missus">Mrs.</abbr> Bucket</p>
</div>
<div class="column">
<h3>Finance Director</h3>
<p>Grandpa Joe</p>
</div>
<div class="column">
<h3>Legal Director</h3>
<p><abbr title="Missus">Mrs.</abbr> Beauregarde</p>
</div>
<div class="column">
<h3>Chief Chocolate Taster</h3>
<p><abbr title="Mister">Mr.</abbr> Teavee</p>
</div>
<div class="column">
<h3>Associate <abbr title="Deputy Minister">DM</abbr> Marketing Board</h3>
<p><abbr title="Missus">Mrs.</abbr> Gloop</p></p>
</div>
</div>
Using unordered list ul
-
Operations Director
Mrs. Bucket
-
Finance Director
Grandpa Joe
-
Legal Director
Mrs. Beauregarde
-
Chief Chocolate Taster
Mr. Teavee
-
Associate DM Marketing Board
Mrs. Gloop
<ul class="row small-up-1 medium-up-2 large-up-3">
<li class="column">
<h3>Operations Director</h3>
<p><abbr title="Missus">Mrs.</abbr> Bucket</p>
</li>
<li class="column">
<h3>Finance Director</h3>
<p>Grandpa Joe</p>
</li>
<li class="column">
<h3>Legal Director</h3>
<p><abbr title="Missus">Mrs.</abbr> Beauregarde</p>
</li>
<li class="column">
<h3>Chief Chocolate Taster</h3>
<p><abbr title="Mister">Mr.</abbr> Teavee</p>
</li>
<li class="column">
<h3>Associate <abbr title="Deputy Minister">DM</abbr> Marketing Board</h3>
<p><abbr title="Missus">Mrs.</abbr> Gloop</p></p>
</li>
</ul>
Smarties
The Smartie design element uses the block grid with the additional HTML for captions, font styles and background colours. Use Smarties to display numbers and statistics, capturing the high level statistics of the content.
Do and do not
Do
- limit the number of Smarties that can be used per page to a maximum of two sets, with three smarties per set
- use
abbr
tags where necessary. Refer to abbreviations.
Do not
- have more than one line of content within a Smartie; if a preposition is needed, choose to use “+” to represent “over”, “~” to represent “approximately”, etc.
- use icons within a Smartie
- override the default font size
Colour options
We currently have 6 options for smartie colours:
red-bg
orange-bg
green-bg
blue-bg
purple-bg
magenta-bg
Blue is the default smartie colour.
Examples
-
1red-bg
-
2orange-bg
-
3green-bg
-
4blue-bg
-
5purple-bg
-
6magenta-bg
<ul class="row small-up-2 medium-up-3 stats">
<li class="text-center column">
<div class="circle red-bg">
<span class="number big">1</span>
</div>
<div class="stats-caption">red-bg</div>
</li>
<li class="text-center column">
<div class="circle orange-bg">
<span class="number big">2</span>
</div>
<div class="stats-caption">orange-bg</div>
</li>
<li class="text-center column">
<div class="circle green-bg">
<span class="number big">3</span>
</div>
<div class="stats-caption">green-bg</div>
</li>
<li class="text-center column">
<div class="circle blue-bg">
<span class="number big">4</span>
</div>
<div class="stats-caption">blue-bg</div>
</li>
<li class="text-center column">
<div class="circle purple-bg">
<span class="number big">5</span>
</div>
<div class="stats-caption">purple-bg</div>
</li>
<li class="text-center column">
<div class="circle magenta-bg">
<span class="number big">6</span>
</div>
<div class="stats-caption">magenta-bg</div>
</li>
</ul>
-
23+types of moose
-
500pages of content on the website
-
6colours for smarties
<ul class="row small-up-2 medium-up-3 stats">
<li class="text-center column">
<div class="circle">
<span class="number big">23+</span>
</div>
<div class="stats-caption">types of moose</div>
</li>
<li class="text-center column">
<div class="circle">
<span class="number big">500</span>
</div>
<div class="stats-caption">pages of content on the website</div>
</li>
<li class="text-center column">
<div class="circle">
<span class="number big">6</span>
</div>
<div class="stats-caption">colours for smarties</div>
</li>
</ul>
Horizontal rules
Use a horizontal line (<hr aria-hidden="true">
) to separate discrete chunks of content.
On ontario.ca, top borders are added to <h2>
s on article pages automatically.
Example
text before the line
text after the line
<p>text before the line</p>
<hr aria-hidden="true">
<p>text after the line</p>
Indenting
Example
Normal paragraph one.
This paragraph is indented.
Another normal paragraph.
<p>Normal paragraph one.</p>
<p class="indent">This paragraph is indented.</p>
<p>Another normal paragraph.</p>
Legal text
Laws, acts, regulations and the names of other documents, such as the Budget or Fall Economic Statement
Examples
Employment Standards Act, 2000
<cite>Employment Standards Act, 2000</cite>
The <cite>2016 Budget</cite> contains initiatives for all Ontarians.
Redacted text
Include a message in an alert box at the top of the page or section.
Examples
Please note: this page contains redacted text.
<p>Please note: this page contains <span class="redacted">redacted text</span>.</p>
With replacement text
On Monday, Notifying Officer of the Toronto Police Service notified the Special Investigations Unit of Mr. Unicorn’s injury.
<p>
On Monday, <span class="redacted" title="redacted">Notifying Officer</span> of the Toronto Police Service notified the Special Investigations Unit of Mr. Unicorn’s injury.
</p>
Without replacement text
On Monday, ---- redacted of the Toronto Police Service notified the Special Investigations Unit of Mr. Unicorn’s injury.
<p>
On Monday, <span class="redacted" title="redacted">----</span> <span class="show-for-sr">redacted</span> of the Toronto Police Service notified the Special Investigations Unit of Mr. Unicorn’s injury.
</p>
Entire paragraphs or pages
Redacted: Witness statements and evidence gathered in the course of the investigation provided to the SIU in confidence (Law Enforcement and Privacy Considerations).
<p class="redacted">
Redacted: Witness statements and evidence gathered in the course of the investigation provided to the <abbr title="Special Investigations Unit">SIU</abbr> in confidence (Law Enforcement and Privacy Considerations).
</p>
Legal list
Example
- Section one
- Clause
- Sub-Clause
- Sub-Sub-Clause
- Sub-Clause
- Sub-Clause
- Clause
- Clause
- Section two
- Clause
- Section three
<ol class="legal-list">
<li>Section one
<ol>
<li>Clause
<ol>
<li>Sub-Clause
<ol>
<li>Sub-Sub-Clause</li>
</ol>
</li>
<li>Sub-Clause</li>
</ol>
</li>
<li>Clause</li>
</ol>
</li>
<li>Section two
<ol>
<li>Clause</li>
</ol>
</li>
<li>Section three</li>
</ol>
Begin at a deeper level of nesting
-
- this item is seven point three
- this item is seven point four
<ol class="legal-list no-bullet" start="7">
<li>
<ol class="legal-list" start="3">
<li>this item is seven point three</li>
<li>this item is seven point four</li>
</ol>
</li>
</ol>
Embed a normal ordered list
Use the .not-legal
class on normal ordered lists within legal lists.
- Section one
- Clause
- Clause
- normal list item one
- normal list item two
<ol class="legal-list">
<li>Section one
<ol>
<li>Clause</li>
<li>Clause
<ol class="not-legal">
<li>normal list item one</li>
<li>normal list item two</li>
</ol>
</li>
</ol>
</li>
</ol>
Links
In this section:
Links lead users to a different page or more information on the same page. They are always underlined, except within navigation and lists of links. Learn more about writing descriptive links in the style guide.
Do and do not
Do
- use meaningful and concise text for links
- describe the target of the link with unique wording
- use relative links for content on the same domain (ontario.ca)
- ServiceOntario
<a href="/page/serviceontario">
- ServiceOntario
- use absolute links for content on other domains
- Destination Ontario
<a href="https://www.destinationontario.com">
- Destination Ontario
- add
https://
to the beginning of absolute hyperlinks- instead of
<a href="www.destinationontario.com">
use<a href="https://www.destinationontario.com">
- instead of
Do not
- use URLs as link text
- instead of
Visit www.ontario.ca/osap for more details
, useVisit OSAP for more details
(and do not forget to include an abbreviation tag!)
- instead of
- use repeated phrases like “Click here” or “More information.” It makes it difficult for users to scan the page.
Accessibility
Users should be able to:
- use the tab key to navigate between links
- follow a link by pressing the “Enter” key
Alert users when opening new windows by including a notice within the link text.
Anchor links
To link to another section on the same page or a specific place on a different page, use the id
attribute as your anchor.
Do and do not
Do
- add a descriptive
id
to the closest element to create a new anchor - use an existing
id
— for example, the second level 2 heading of a page always will be#section-1
as level 2 headings haveid
automatically assigned once published, starting from#section-0
Do not
- use empty
<a>
tags for anchors such as<a id="january" name="january"></a>
- add
id
attribute to level 2 headings, use<span>
or another existing element instead - repeat
id
attributes on the same page as eachid
must be unique
id
and anchor links
id
attribute values must:
- begin with a letter
- contain only non-accented letters, numbers, hyphens or underscores
Examples
Linking to same page
<a href="#section-1">This is a link to the second section on this page.</a>
Canadian cities
Visit Canadian cities.<h2><span id="canadian-cities">Canadian cities</span></h2>
Visit <a href="#canadian-cities">Canadian cities</a>.
Toronto
Find details for Toronto.<h3 id="toronto">Toronto</h3>
Find <a href="#toronto">details for Toronto</a>.
Linking to another ontario.ca page
Find out <a href="/page/how-apply-osap#section-1">how to apply for <abbr title="Ontario Student Assistance Program">OSAP</abbr></a>.
Learn about <a href="/page/ultraviolet-radiation-workplace#engineering">ultraviolet radiation workplace engineering controls</a>.
Email addresses and phone numbers
Refer to contact information.
Opening new windows
Generally, do not use "target="_blank"
to open links in a new window. Only use this on pages with forms where user data would be lost by opening a link in the same window.
Example
Read the <a href="/page/ontario-government-service-standards" target="_blank">service standards<abbr title="opens new window"><span class="icon-share"></span></abbr></a> for how long it will take to get a reply.
Other languages
Learn about linking to content in other languages.
Linking to non-HTML content
If you wish to publish content in a format other than HTML on ontario.ca, please contact Cabinet Office Digital.
Example
<a href="https://docs.ontario.ca/documents/1841/go-its-23-government-of-ontario-web-standard.pdf"><abbr title="Government of Ontario Information Technology Standards">GO-ITS</abbr> 23 Government of Ontario Web Standard (<abbr title="portable document format">PDF</abbr>)</a>
List of links
Refer to lists of links and list of links displayed in a single line.
Prominent links and calls to action
If there is one or several links on a page that need to stand out, you can style them to look like a button.
Broken links
It is important to review every link on a page regularly to ensure that it is still works. Broken links limit access to information and can make our user lose trust in our content.
Related content
When linking to related content on a full-width landing page, place the links at the end of your content in the body, instead of the Links sidebar.
Examples
Related
<hr aria-hidden="true">
<h2>Related</h2>
<ul class="no-bullet">
<li><a href="/page/study-abroad">Study abroad</a></li>
<li><a href="/page/choose-career">Choose a career</a></li>
</ul>
Liens connexes
<hr aria-hidden="true">
<h2>Liens connexes</h2>
<ul class="no-bullet">
<li><a href="/fr/page/etudier-letranger">Étudier à l’étranger</a></li>
<li><a href="/fr/page/choix-de-carriere">Choix de carrière </a></li>
</ul>
Lists
In this section:
Related: legal lists
Lists are a great way to organize related information. Lists add structure to your content, making it more accessible and easier to understand.
Unordered lists
Use unordered lists to group related items that do not have a specific order. Learn more about bulleted lists in the style guide.
Example
- item one
- item two
- item three
- item four
<ul>
<li>item one</li>
<li>item two</li>
<li>item three</li>
<li>item four</li>
</ul>
Links
Example
<ul>
<li><a href="http://example.com/one">link one</a></li>
<li><a href="http://example.com/two">link two</a></li>
<li><a href="http://example.com/three">link three</a></li>
</ul>
Nested lists
Additional <ul>
s can only be nested within <li>
s.
Example
- item one
- first subitem for item one
- second subitem for item one
- item two
- item three
- first subitem for item two
- second subitem item two
<div class="row">
<div class="medium-6 columns">
<ul>
<li>item one
<ul>
<li>first subitem for item one</li>
<li>second subitem for item one</li>
</ul>
</li>
<li>item two</li>
<li>item three
<ul>
<li>first subitem for item two</li>
<li>second subitem item two</li>
</ul>
</li>
</ul>
</div>
Hide bullets
Note that the list will not be indented.
Example
- item one
- item two
- item three
- item four
<ul class="no-bullet">
<li>item one</li>
<li>item two</li>
<li>item three</li>
<li>item four</li>
</ul>
Horizontal list
Example
- item one
- item two
- item three
- item four
<ul class="inline-list">
<li>item one</li>
<li>item two</li>
<li>item three</li>
<li>item four</li>
</ul>
Horizontal link list
Example
<ul class="inline-list">
<li><a href="http://example.com/one">link one</a></li>
<li><a href="http://example.com/two">link two</a></li>
<li><a href="http://example.com/three">link three</a></li>
</ul>
Ordered lists
Use ordered lists to group related items that have a specific order. Learn more about numbered lists in the style guide.
Example
- item one
- item two
- item three
- item four
<ol>
<li>item one</li>
<li>item two</li>
<li>item three</li>
<li>item four</li>
</ol>
Nested list
Example
- item one
- first subitem for item one
- second subitem for item one
- item two
- item three
- first subitem for item two
- second subitem item two
<ol>
<li>item one
<ol>
<li>first subitem for item one</li>
<li>second subitem for item one</li>
</ol>
</li>
<li>item two</li>
<li>item three
<ol>
<li>first subitem for item two</li>
<li>second subitem item two</li>
</ol>
</li>
</ol>
Alphabetical list
Example
- item one
- item two
- item three
- item four
<ol type="a">
<li>item one</li>
<li>item two</li>
<li>item three</li>
<li>item four</li>
</ol>
- item one
- item two
- item three
- item four
<ol type="A">
<li>item one</li>
<li>item two</li>
<li>item three</li>
<li>item four</li>
</ol>
Roman numerals list
Example
- item one
- item two
- item three
- item four
<ol type="i">
<li>item one</li>
<li>item two</li>
<li>item three</li>
<li>item four</li>
</ol>
- item one
- item two
- item three
- item four
<ol type="I">
<li>item one</li>
<li>item two</li>
<li>item three</li>
<li>item four</li>
</ol>
Interrupted list
Example
- item one
- item two
This paragraph interrupts the list.
- item three
- item four
<ol>
<li>item one</li>
<li>item two</li>
</ol>
<p>This paragraph interrupts the list.</p>
<ol start="3">
<li>item three</li>
<li>item four</li>
</ol>
List with parentheses
Examples
- item one
- item two
- item three
- item four
<ol class="parentheses-right">
<li>item one</li>
<li>item two</li>
<li>item three</li>
<li>item four</li>
</ol>
- item one
- item two
- item three
- item four
<ol class="parentheses">
<li>item one</li>
<li>item two</li>
<li>item three</li>
<li>item four</li>
</ol>
- item one
- item two
- item three
- item four
<ol type="a" class="parentheses-right">
<li>item one</li>
<li>item two</li>
<li>item three</li>
<li>item four</li>
</ol>
- item one
- item two
- item three
- item four
<ol class="parentheses" type="a">
<li>item one</li>
<li>item two</li>
<li>item three</li>
<li>item four</li>
</ol>
- item one
- item two
- item three
- item four
<ol class="parentheses-right" type="i">
<li>item one</li>
<li>item two</li>
<li>item three</li>
<li>item four</li>
</ol>
- item one
- item two
- item three
- item four
<ol class="parentheses" type="i">
<li>item one</li>
<li>item two</li>
<li>item three</li>
<li>item four</li>
</ol>
- Section one
- Clause
- Sub-Clause
- Sub-Sub-Clause
- Sub-Clause
- Sub-Clause
- Clause
- Clause
- Section two
- Clause
- Section three
<ol class="legal-list-parentheses">
<li>Section one
<ol>
<li>Clause
<ol>
<li>Sub-Clause
<ol>
<li>Sub-Sub-Clause</li>
</ol>
</li>
<li>Sub-Clause</li>
</ol>
</li>
<li>Clause</li>
</ol>
</li>
<li>Section two
<ol>
<li>Clause</li>
</ol>
</li>
<li>Section three</li>
</ol>
Multi-column lists
For long lists with short items, you can have the list display in columns. Use the class columns-x-large
to get very wide columns, or columns-large
, columns-medium
, columns-small
, and columns-x-small
for narrower columns. They will automatically adjust for the screen size.
Examples
- list item
- list item
- list item
- list item
- list item
- list item
- list item
- list item
- list item
- list item
<ol class="columns-small">
<li>list item</li>
<li>list item</li>
<li>list item</li>
<li>list item</li>
<li>list item</li>
<li>list item</li>
<li>list item</li>
<li>list item</li>
<li>list item</li>
<li>list item</li>
</ol>
- this is a list item lorem ipsum
- this is a list item lorem ipsum
- this is a list item lorem ipsum
- this is a list item lorem ipsum
- this is a list item lorem ipsum
- this is a list item lorem ipsum
- this is a list item lorem ipsum
- this is a list item lorem ipsum
- this is a list item lorem ipsum
- this is a list item lorem ipsum
<ul class="columns-x-large">
<li>this is a list item lorem ipsum</li>
<li>this is a a list item lorem ipsum</li>
<li>this is a list item lorem ipsum</li>
<li>this is a list item lorem ipsum</li>
<li>this is a list item lorem ipsum</li>
<li>this is a list item lorem ipsum</li>
<li>this is a list item lorem ipsum</li>
<li>this is a list item lorem ipsum</li>
<li>this is a list item lorem ipsum</li>
<li>this is a list item lorem ipsum</li>
</ul>
Definition lists
Use definition lists to associate terms with their meaning or a description.
Example
- Lower cost
- The new version of this product costs significantly less than the previous one!
- Easier to use
- We’ve changed the product so that it’s much easier to use!
- More features
- The new version does x, y, and z.
<dl>
<dt>Lower cost</dt>
<dd>The new version of this product costs significantly less than the previous one!</dd>
<dt>Easier to use</dt>
<dd>We’ve changed the product so that it’s much easier to use!</dd>
<dt>More features</dt>
<dd>The new version does x, y, and z.</dd>
</dl>
Numbers
In this section:
Related: phone numbers.
Write numbers greater than nine with digits rather than words. If the number is at the beginning of a sentence in a paragraph, write it out. Learn more about numbers in the style guide.
General numbers
Examples
5 million
5 millions
Use a comma (non-breaking space in French) in numbers with four digits or more, except for years, addresses, and currency.
Examples
1,400 employees
1 400 employés
Use “%” (percentage symbol) to show percentages. Do not spell out “per cent” unless it follows a spelled-out number at the beginning of a sentence.
Examples
20%
20 %
Number ranges
Use an en dash, not the hyphen-minus character on your keyboard.
Examples
$4,000–$10,000
4 000 $–10 000 $
4–10 years
4–10 ans
12–15 years old
16+ years old
Ordinal numbers
Use superscript when not writing ordinal numbers in full.
Examples
1<sup>st</sup> prize
2<sup>nd</sup>
1<sup>er</sup> prix
2<sup>e</sup>
Roman numerals
Do not use roman numerals unless they are legally required or used to refer to parts of other web pages or documents. Add abbreviation tags to roman numerals. Refer to abbreviations and roman-numeral ordered list.
Fractions
For common fractions such as ½, use fraction characters.
Do not include a space between numbers when using fractions.
Example
age over 15½, 1/10 of an apple
Do not use “th” after fractions expressed in numerals
Example
use 1/25 not 1/25th
Do hyphenate ages if they contain fractions.
Example
3½-year-old
Ages
Examples
4 years old
12‑years‑old boy
The above example uses non-breaking hyphens.
Example
12–15 years old
Money
Money should have either two decimal places (i.e. cents) or be rounded to the nearest dollar (or thousand, million, or billion dollars). Learn more about money in the style guide.
Dates and times
Learn more about dates and times in the style guide.
Related: hours of operation.
Examples
5:30 p.m.
Monday to Friday, 9 a.m. to 5 p.m.
January 1970
January 1, 1970
Quotes and references
In this section:
For citing acts, laws, and other documents refer to acts and laws.
Quotes
Quotations can be from people or other sources, for example, web pages and other documents. Do not use quotation marks. Use <q>
for short quotes within a sentence and <blockquote>
for one paragraph or longer quotes.
Blockquotes
Blockquotes are used to indicate that a piece of content is a quotation from a source or speaker. This often includes a cite attribute for the URL of the quote’s source or the speaker’s name, to provide context.
You do not have to include quotation marks in the copy of your blockquote, because the blockquote style will add them for you.
Examples
Within a sentence
As Isaac Asimov said about computers, I fear the lack of them
.
<p>As Isaac Asimov said about computers, <q>I fear the lack of them</q>.</p>
Everybody knows that ice fishing is a great family activity
, but it is also inexpensive.
<p>Everybody knows that <q cite="https://news.ontario.ca/mnr/en/2016/02/go-ice-fishing-for-free-this-family-day-weekend.html">ice fishing is a great family activity</q>, but it is also inexpensive.</p>
Blockquotes
It is an enormous privilege to be asked to conduct the third review of the Accessibility for Ontarians with Disabilities Act, and a pleasure to accept. Since the act’s introduction in 2005, Ontario has made great progress towards becoming a functionally accessible province by the target date of 2025. While much remains to be done, I believe the goal is achievable and look forward to making recommendations that will get us there. I thank the Honourable Tracy MacCharles for the confidence she has shown in appointing me and I am eager to begin.
The Late Honourable David C. Onley, 28th Lieutenant Governor of Ontario Ontario Newsroom
<blockquote>
<p>It is an enormous privilege to be asked to conduct the third review of the <cite>Accessibility for Ontarians with Disabilities Act</cite>, and a pleasure to accept. Since the act’s introduction in 2005, Ontario has made great progress towards becoming a functionally accessible province by the target date of 2025. While much remains to be done, I believe the goal is achievable and look forward to making recommendations that will get us there. I thank the Honourable Tracy MacCharles for the confidence she has shown in appointing me and I am eager to begin.
</p>
<cite class="blockquote__attribution">The Late Honourable David C. Onley, 28th Lieutenant Governor of Ontario</cite>
<cite class="blockquote__byline">Ontario Newsroom</cite>
</blockquote>
This is a quote that mentions the Employment Standards Act.
Joe Shmoe
<blockquote class="blockquote--short">
<p>This is a quote that mentions the <cite">Employment Standards Act</cite>.</p>
<cite class="blockquote__attribution">Joe Shmoe</cite>
</blockquote>
Quotation marks
Use quotation marks if not using the <q>
or <blockquote>
elements, for example, when referring to a word. Use curly quotation marks instead of straight quotation marks. The HTML entities are “
for the opening quotation mark and ”
for the closing quotation mark.
Example
It is an oil-extraction method known as “fracking.”
<p>It is an oil-extraction method known as “fracking.”</p>
Footnotes
Footnotes should only be used when there is a legal reason for the website to match a print publication with footnotes. If the information is very important, add it into the body text where it makes sense rather than using a footnote.
The footnote feature uses custom HTML for ontario.ca and will not work anywhere else. The footnote text will become a link to the “Footnotes” section created automatically at the bottom of the page.
Do
- include
<onesite-ref number="#">Footnote text</onesite-ref>
where you want the footnote reference to appear - use numbers, letters or roman numerals in the
number
attribute - within a single page, to reuse a footnote, repeat the
number
while omitting the footnote text, for example<onesite-ref number="#"></onesite-ref>
- use continuous numbering for the footnotes throughout the pages of a book, since they can be joined when printing
Do not
- add a space before the tag
- repeat the footnote text in the page body
- restart numbering on each page in a book
Examples
There are 14.3 million people in Ontario
<p>
There are 14.3 million people in Ontario<onesite-ref number="1"><a href="https://www150.statcan.gc.ca/t1/tbl1/en/tv.action?pid=1710000501&pickMembers%5B0%5D=1.7&pickMembers%5B1%5D=2.1">Population by year, by province and territory</a>, Statistics Canada.</onesite-ref>, compared to 10 million in Michigan.<onesite-ref number="2"><a href="https://www.census.gov/quickfacts/mi"><abbr title="United States">U.S.</abbr> Census Bureau QuickFacts: Michigan</a></onesite-ref> The biggest age group in Ontario are those aged 55 to 59.<onesite-ref number="1"></onesite-ref>
</p>
There are 65,000 employees
<p>
There are 65,000 employees<onesite-ref number="A">2015 <abbr title="Ontario Public Serivce">OPS</abbr> Employee Survey</onesite-ref> in the Ontario Public Service.
</p>
Tables
In this section:
Use tables to present data in a grid or matrix that makes it easy to compare or contrast values.
Do and do not
Do
- use tables for tabular information and to quickly contrast detailed data and precise values
- describe the content of your table in a heading above it or using a caption (refer to caption vs. summary)
- format dates within tables using ISO 8601 format: YYYY-MM-DD
- use abbreviated months (such as Jan, Feb, Mar) in tables only, if needed to save space
- mark up header cells with
<th>
and data cells with<td>
(refer to table structure) - mark up abbreviations and acronyms used in tables
- include units of measurement in the column headers ($, cm, kg, etc.)
- use sentence case for table headings
Do not
- use tables for layout
- use tables if you only have a few rows or few columns — use a list instead
- leave cells in a table header empty
- leave data cells empty — use “N/A” (for “not applicable” or “not available”; wrapped in an
<abbr>
tag withtitle="not applicable"
or"not available"
), “null” or “0” - create complex tables where cells span multiple rows or multiple columns
- include headers within a table — use multiple tables instead
- repeat units of measurement in individual data cells
Table structure
Every table:
- begins and ends with a
<table>
tag - has a header
<thead>
, which contains only the header cell information of the table, not the data. The header contains:- one row
<tr>
</tr>
- header cells (visually bolding the text)
<th>
</th>
- one row
- has a body
<tbody>
, that contains the data within:- rows
<tr>
</tr>
- rows
Accessibility
With the proper HTML markup, visually impaired users can navigate and read out your data one cell at a time by using their keyboard and the use of an assistive technology, such as a screen reader.
Describe tables with either a heading, brief descriptive text before or after the table that detail the table’s contents, or with a <caption>
.
Do not use complex tables that require both header and id
attributes for accessibility. Instead, use multiple tables with the scope attribute to make the table accessible to screen readers.
Using the scope attribute
For simple tables that have only the row header or column header, use the <th>
elements without scope
.
Otherwise, all <th>
elements should have the scope
attribute, which allows screen readers to detect column headers and row headers. The scope
attribute tells the browser and screen reader that column cells with the scope="col"
are column headers and row cells with scope="row"
are row headers. When navigating through the table, screen readers read out one cell at a time and reference the associated header cells.
Caption vs. Summary
Captions help readers understand the context of the table. Captions can be the table’s title and/or description.
Summaries helps readers understand the structure and organization of the table. The summary attribute is used with complex tables to convey information about what content can be found in which column or row. Tables of this complexity should be avoided and few screen readers read out the summary attribute. Instead, break them up into simpler tables.
Examples
Table with a caption
Add the <caption>
tag immediately after the <table>
tag.
Example
Name | Age | Favourite colour |
---|---|---|
John Doe | 10 | green |
Jörg Ingersleben | 11 | blue |
Husayn Damjan Darzi | 10 | orange |
<table>
<caption>This is a caption, which indicates the table’s title and/or purpose.</caption>
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Age</th>
<th scope="col">Favourite colour</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">John Doe</th>
<td>10</td>
<td>green</td>
</tr>
<tr>
<th scope="row">Jörg Ingersleben</th>
<td>11</td>
<td>blue</td>
</tr>
<tr>
<th scope="row">Husayn Damjan Darzi</th>
<td>10</td>
<td>orange</td>
</tr>
</tbody>
</table>
Table with row and column headers
All <th>
elements use the scope attribute. Column headers use scope="col"
. Row headers use scope="row"
.
Example
Name | Age | Favourite colour |
---|---|---|
John Doe | 10 | green |
Jörg Ingersleben | 11 | blue |
Husayn Damjan Darzi | 10 | orange |
<table>
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Age</th>
<th scope="col">Favourite colour</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">John Doe</th>
<td>10</td>
<td>green</td>
</tr>
<tr>
<th scope="row">Jörg Ingersleben</th>
<td>11</td>
<td>blue</td>
</tr>
<tr>
<th scope="row">Husayn Damjan Darzi</th>
<td>10</td>
<td>orange</td>
</tr>
</tbody>
</table>
Table with column headers
Use the <th>
elements without scope
.
Example
Date | Address | Time |
---|---|---|
1999-01-01 | 1 Main Street | 5:30 p.m. |
2013-03-03 | 33 Front Road | 3:33 p.m. |
2017-12-12 | 123 Happy Crescent | 6:18 p.m. |
<table>
<thead>
<tr>
<th>Date</th>
<th>Address</th>
<th>Time</th>
</tr>
</thead>
<tbody>
<tr>
<td>1999-01-01</td>
<td>1 Main Street</td>
<td>5:30 p.m.</td>
</tr>
<tr>
<td>2013-03-03</td>
<td>33 Front Road</td>
<td>3:33 p.m.</td>
</tr>
<tr>
<td>2017-12-12</td>
<td>123 Happy Crescent</td>
<td>6:18 p.m.</td>
</tr>
</tbody>
</table>
Table without zebra striping
By default, tables are styled with alternating white and light coloured backgrounds for each row. This helps users to better differentiate the values of one row from another. If you wish to turn it off, use the .no-stripes
class on the <table>
element.
Example
Name | Age | Favourite colour |
---|---|---|
John Doe | 10 | green |
Jörg Ingersleben | 11 | blue |
Husayn Damjan Darzi | 10 | orange |
<table class="no-stripes">
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Age</th>
<th scope="col">Favourite colour</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">John Doe</th>
<td>10</td>
<td>green</td>
</tr>
<tr>
<th scope="row">Jörg Ingersleben</th>
<td>11</td>
<td>blue</td>
</tr>
<tr>
<th scope="row">Husayn Damjan Darzi</th>
<td>10</td>
<td>orange</td>
</tr>
</tbody>
</table>
Numbers and summary / total rows
If your table has one or more columns of numbers, use the .numeric
class. It aligns the numbers, making them easier to compare.
Remember to add the .non-numeric
class to all <td>
s in non-numeric columns (and <th>
s in the <thead>
) to remove number formatting.
Example
City | 2011 population | 2006–2011 population change % |
---|---|---|
Barrie | 136,063 | 5.9 |
Belleville | 49,454 | 1.3 |
Brampton | 523,911 | 20.8 |
<table class="numeric">
<thead>
<tr>
<th class="non-numeric" scope="col">City</th>
<th scope="col">2011 population</th>
<th scope="col">2006–2011 population change<br>%</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Barrie</th>
<td>136,063</td>
<td>5.9</td>
</tr>
<tr>
<th scope="row">Belleville</th>
<td>49,454</td>
<td>1.3</td>
</tr>
<tr>
<th scope="row">Brampton</th>
<td>523,911</td>
<td>20.8</td>
</tr>
</tbody>
</table>
Subtotal and total rows
Make tables accessible by creating multiple tables instead of combining multiple subtotal and totals in one table. This avoids complex header and id
markup and ensures the table is accessible to the widest possible audience.
Examples
City | 2011 population | 2006–2011 population change % |
---|---|---|
Barrie | 136,063 | 5.9 |
Belleville | 49,454 | 1.3 |
Brampton | 523,911 | 20.8 |
Brant | 35,638 | 3.6 |
Cambridge | 126,748 | 5.3 |
Clarence-Rockland | 23,185 | 11.5 |
Cornwall | 46,340 | 0.8 |
Total | 2011 population |
---|---|
Bcities total |
745,066 |
Ccities total |
49,454 |
Grand total | 523,911 |
<table class="full-width numeric">
<caption>Population and population change by city</caption>
<thead>
<tr>
<th class="non-numeric" scope="col">City</th>
<th scope="col">2011 population</th>
<th scope="col">2006–2011 population change<br>%</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Barrie</th>
<td>136,063</td>
<td>5.9</td>
</tr>
<tr>
<th scope="row">Belleville</th>
<td>49,454</td>
<td>1.3</td>
</tr>
<tr>
<th scope="row">Brampton</th>
<td>523,911</td>
<td>20.8</td>
</tr>
<tr>
<th scope="row">Brant</th>
<td>35,638</td>
<td>3.6</td>
</tr>
<tr>
<th scope="row">Cambridge</th>
<td>126,748</td>
<td>5.3</td>
</tr>
<tr>
<th scope="row">Clarence-Rockland</th>
<td>23,185</td>
<td>11.5</td>
</tr>
<tr>
<th scope="row">Cornwall</th>
<td>46,340</td>
<td>0.8</td>
</tr>
</tbody>
</table>
<table class="full-width numeric">
<caption>Cities subtotals and totals</caption>
<thead>
<tr>
<th class="non-numeric" scope="col">Total</th>
<th scope="col">2011 population</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row"><q>B</q> cities total</th>
<td>745,066</td>
</tr>
<tr>
<th scope="row"><q>C</q> cities total</th>
<td>49,454</td>
</tr>
</tbody>
<tfoot>
<tr>
<th scope="row">Grand total</th>
<td>523,911</td>
</tr>
</tfoot>
</table>
Multiple tables
Break complex tables into multiple simple tables.
Multiple tables on the same page with the same headers should have consistent widths. Use the .full-width
class on the <table>
and the w-#
class on <th>
s, where # is a percentage of the overall table width.
Examples
Short | Long |
---|---|
Arizona | this is some text |
Brazil | this is more text |
Short | Long |
---|---|
Quarterly | yet more text about stuff |
Fiscal year | even more text and things |
<table class="full-width">
<caption>Table 1</caption>
<thead>
<tr>
<th class="w-20" scope="col">Short</th>
<th class="w-80" scope="col">Long</th>
</tr>
</thead>
<tbody>
<tr>
<td>Arizona</td>
<td>this is some text</td>
</tr>
<tr>
<td>Brazil</td>
<td>this is more text</td>
</tr>
</tbody>
</table>
<table class="full-width">
<caption>Table 2</caption>
<thead>
<tr>
<th class="w-20" scope="col">Short</th>
<th class="w-80" scope="col">Long</th>
</tr>
</thead>
<tbody>
<tr>
<td>Quarterly</td>
<td>yet more text about stuff</td>
</tr>
<tr>
<td>Fiscal year</td>
<td>even more text and things</td>
</tr>
</tbody>
</table>
Wide tables
Use .full-width
to make the table as wide as the page. A table causes horizontal scrollbars to appear on small screens because it is wider than the content area.
Example
Table Header | Table Header |
---|---|
Content Goes Here | This is longer content Donec id elit non mi porta gravida at eget metus.
A paragraph within a table cell. |
Content Goes Here | This is longer Content Goes Here Donec id elit non mi porta gravida at eget metus.
|
Content Goes Here | This is longer Content Goes Here Donec id elit nom mi porta gravida et eget metus. |
<table class="full-width">
<thead>
<tr>
<th scope="col">Table Header</th>
<th scope="col">Table Header</th>
</tr>
</thead>
<tbody>
<tr>
<td>Content Goes Here</td>
<td>This is longer content Donec id elit non mi porta gravida at eget metus.
<p>A paragraph within a table cell.</p>
</td>
</tr>
<tr>
<td>Content Goes Here</td>
<td>This is longer Content Goes Here Donec id elit non mi porta gravida at eget metus.
<ul>
<li>List item 1</li>
<li>List item 2</li>
</ul>
</td>
</tr>
<tr>
<td>Content Goes Here</td>
<td>This is longer Content Goes Here Donec id elit nom mi porta gravida et eget metus.</td>
</tr>
</tbody>
</table>
Long tables (interactive tables)
For tables with more than 20 rows, adding a sort and/or search function can benefit users if they are looking for specific information.
On ontario.ca, we have a content type specifically for long tables, called an interactive table.
To make an interactive table, send a UTF-8 encoded CSV or or JSON file to your Open Data lead to upload to the Ontario Data Catalogue. The first row must have the column headers and cannot have the name "id" or contain any HTML. Following rows must contain the data for each column. Treat content in interactive tables like regular content on the page and use HTML as needed (<abbr>
, <cite>
, etc.)
Ontario’s Open Data Directive requires all government data, including data used in interactive tables, to be listed in Ontario’s Data Catalogue as open data unless exempt for legal, privacy, security, confidentiality or commercially-sensitive reasons. Learn more in the Open Data Guidebook.
Learn more at Ontario.ca: Interactive tables (InsideOPS internal link).
Example
Typography
In this section:
All-caps
All caps are considered the written equivalent of “shouting” at a user.
Do and do not
Do
- write the text in proper case or lowercase and use the
.uppercase
class to have it display as all-caps.
Do not
- use all-caps text unless it is part of a brand/program name (like Presto), it is legally required or it is an abbreviation
Accessibility
All-caps reduces readability for all users. Some screen reader software will read all-caps text letter-by-letter.
Examples
This sentence has <span class="uppercase">one part</span> that will display as uppercase.
Get a <span class="uppercase">Presto</span> card.
This entire paragraph will display as uppercase.
<p class="uppercase">This entire paragraph will display as uppercase.</p>
Bold and italics
Learn how to add emphasis in the style guide.
Do and do not
Do
- use
<cite>
for laws, acts, regulations, media such as a books, films, etc., and documents such as Budget or Fall Economic Statement - use
<strong>
to make text bold - use
<i>
for the genus of organisms and scientific names of species - use sparingly: bolding everything is the same as bolding nothing
- highlight a whole paragraph or section with a callout instead of
<strong>
tags - highlight multiple words or phrases you are describing with a definition list
Do not
- use
<i>
except for for the genus of organisms and scientific names of species - use
<em>
or<u>
- use
<b>
or bolding - use
<strong>
for titles, instead use headings - use italics or all-caps when the text is bolded
Accessibility
<b>
is a style tag — it bolds text only visually. Screen readers do not parse it, making the emphasis inaccessible.
<strong>
is a semantic tag — it bolds text visually and flags for accessibility software that the text is emphasized, making this the accessible option.
Avoid italicizing text because it is difficult for people with visual or cognitive impairments to read. If you need to emphasize text, use the <strong>
tag.
Scientific names
For the genus of organisms and scientific names of species.
Examples
<i lang="la">Homo sapiens</i>
Grey wolf (<i lang="la">Canis lupis</i>)
<i lang="la"><abbr title="homo">H.</abbr> sapiens</i>
Font size
Do and do not
Do
- change font size if necessary when building infographics and visualizations
Do not
- change font size in paragraphs or lists
- use these styles for headings, refer to headings
Examples
Make one <span class="small">word</span> small.
Make one <span class="large">word</span> large.
Headings
Headings are used to break content up into smaller chunks. They help you organize sections and subsections. Learn how to write a heading in the style guide.
On ontario.ca, level 2 headings <h2>
generate a table of contents for the page. Do not add id
attributes to <h2>
on ontario.ca if you are using the table of contents feature — they are automatically created when the page is published.
Do and do not
Do
- use
h2
toh6
headings (in order) to further structure your page- for example, use an
h3
under anh2
, anh4
under anh3
, etc.
- for example, use an
- resize headings on content laid out in columns on landing pages by adding
class="h4"
Do not
- use
h1
in the body as it is reserved for the page title - skip heading levels
- for example, do not put an
h3
under the page title without anh2
in between
- for example, do not put an
- resize headings within the body of content
Examples
Level 2 heading
<h2>Level 2 heading</h2>
Level 3 heading
<h3>Level 3 heading</h3>
Level 4 heading
<h4>Level 4 heading</h4>
Level 5 heading
<h5>Level 5 heading</h5>
Level 6 heading
<h6>Level 6 heading</h6>
Paragraphs and line breaks
Learn how to write paragraphs and sentences in the style guide.
Examples
This is a sentence. This is another sentence.
This is paragraph number two. Do you like this paragraph?
<p>
This is a sentence.
This is another sentence.
</p>
<p>
This is paragraph number two.
Do you like this paragraph?
</p>
This is line 1.
This is line 2.
<p>
This is line 1.<br>
This is line 2.
</p>
Super and subscript
Used for some chemical formulae. Learn about ordinal numbers and units for use of superscript.
Example
<abbr title="carbon dioxide">CO<sub>2</sub></abbr>
Footnotes
- footnote[1] Back to paragraph Population by year, by province and territory, Statistics Canada.
- footnote[2] Back to paragraph U.S. Census Bureau QuickFacts: Michigan
- footnote[A] Back to paragraph 2015 OPS Employee Survey