NZ government logo markup
Use this HTML markup with the NZ government logo to make it accessible.
Requirements for government websites
As part of the NZ Government Web Usability Standard, government websites are required to display a visible link to Govt.nz, ideally using a suitable NZ government logo.
- Web Usability Standard 1.3 — Section 2.1
- New Zealand Government Identity — Public Service Commission
Government websites are also required to follow the Web Accessibility Standard, which includes making images accessible.
Accessibility considerations
To meet the above standards and offer an accessible experience of the logo for as many users as possible, the HyperText Markup Language (HTML) should:
- reinforce the visual treatment of the Māori and English texts in the logo
- programmatically identify that some of the text in the logo is in te reo Māori and some in English
- work well with current browser and screen reader combinations.
Communicate the logo in both languages
For sighted users, the logo contains the government’s name in both English and te reo Māori.
So that assistive technologies, like screen readers, communicate the same bilingual information to their users, specific HTML markup is needed.
One version of the name is included in the alt
attribute on the <img>
element that holds the logo.
The other language version of the name is included as visually hidden text alongside the <img>
element. Sighted users cannot see it, but it remains available to assistive technologies and will be announced by screen readers.
A lang
attribute on the element containing the visually hidden text signals that it’s in a different language from the page’s main language.
Where each language version goes
Which version of the government’s name to use in the alt
attribute of the <img>
depends on which language is declared in the lang
attribute on the <html>
element for the page as a whole.
When the value of the lang
attribute on the page’s <html>
element is mi
, <html lang="mi">
, the alt
attribute of the logo’s <img>
will be the government’s name in Māori.
The visually hidden text will be the government’s name in English and its containing element will have lang="en-NZ"
.
When the value of the lang
attribute on the page’s <html>
element is en-NZ
, <html lang="en-NZ">
, the alt
attribute of the logo’s <img>
will be the government’s name in English.
The visually hidden text will be the government’s name in Māori and its containing element will have lang="mi"
.
Visually hidden text
The markup for the logo assumes that the web page's Cascading Style Sheets (CSS) includes a utility class for visually hiding content from sighted users, but keeping it available to assistive technologies.
This type of utility class is often named visually-hidden
or sr-only
(for ‘screen reader-only’). The recommended logo markup uses visually-hidden
.
Inclusively Hidden — Scott O’Hara website
HTML markup to apply
Apply the markup option for the type of image you’re using and the language of the web page.
Browser and screen-reader tested
The markup patterns have been successfully tested and should work in all commonly used browser and screen-reader combinations — for example, JAWS and NVDA in Chrome on Windows, or VoiceOver in Safari on iOS.
Utility links and page information
Last updated