Skip to Main Content
Go to Penn Libraries homepage   Go to Guides homepage

Accessible Code for Content Providers

"Don't be annoying."

Respect the users' time. Screen readers take long enough when everything is perfect.

Avoid All Caps

Many screen readers spell out all caps as A-C-R-O-N-Y-M-S.

You can still present all caps to your visual readers without torturing listeners. Use CSS styling: 

CSS for all caps

<div style="text-transform: uppercase;">css for all caps></div>

Guides Extra:

Use this class.:

<div class="all-caps">Guides extra</div>

Avoid target="_new", target="_blank"

When a link opens a new tab, the back button is lost. All history is lost. Anyone who navigates without a mouse is lost!

A sighted, mouse-user can always open a new tab by holding down Control (Command on a Mac) and clicking the link. That's good enough!

If your boss insists on a new tab...

...at least tell screen readers why they're lost. Use text that's visually hidden like this:

<a href="page.html" target="_blank">Descriptive linking text<span class="visually-hidden"> (Opens new tab.)</span></a>

Label Languages

If you're working with a content management system at Penn, the default language of your page will usually be set to English. Language is set in the html tag: <html lang="en">.

But, in your page content, if you use non-English words, screenreaders will force an excrutiating English pronunciation. Screenreaders are fluent in hundreds of languages, but, unlike Google, they don't recognize languages. You have to tell them. (Language recognition is coming but it's not here.)

Below, the Telugu language is labeled using

  • <span> tag,
  • lang attribute, and
  • "tel" - the correct language code for Teluga:
The Telugu manuscript is a late 18th or early 19th century rendition of the <span lang="tel">Āmuktamālyada</span>(Giver of the Worn Garland), an epic poem attributed to <span lang="ml">Krishnadevaraya</span>.

More information:

The official list of language codes

About declaring languages

Or ask ALT for help with language codes.

Penn Libraries Home Franklin Home
(215) 898-7555