How to Display Keyboard Shortcuts on a Web Page in Firefox

Using keyboard shortcuts or hotkeys can save you lot of time while navigating between and within open applications, dialog boxes, access menu items or while performing simple tasks like copy, paste etc.

Keyboard shortcuts also come in handy while browsing the internet. Lots of web pages showcase their shortcuts well while others go unnoticed. If you are using Firefox, a small CSS tweak can show which links on a web page have keyboard shortcuts.

Follow these simple steps to get the job done:

1. Hit “Start”  > “Run”.

2. Type %appdata%\Mozilla\Firefox\Profiles and press “OK”.

Run Prompt

A new window showing the folder of your current profile will appear.

Default Profile Folder

3. Open that folder and head into the folder named “chrome”.

userContent.css File

4. Rename the file “userContent-example.css” to “userContent.css”.

Rename The CSS File

5. Open the file in your favorite text editor and add the following code:

a[accesskey]:after,

button[accesskey]:after,

input[accesskey]:after,

label[accesskey]:after,

legend[accesskey]:after,

textarea[accesskey]:after

{

margin-left: 0.3em;

content: “[" attr(accesskey) "]“;

}

6. Save it and close the editor and then the window. Restart Firefox.

The code we just added will check the web page for all the HTML elements having an access key attribute and, if found, will display them beside the corresponding element.

Following two screenshots will make it clear. Before editing the codes, the Wikipedia page containing search result for the word ‘Google’ was like below. You can only see the keyboard shortcuts when you hover the mouse pointer on the HTML element.

Normal Web Page

But, after the CSS editing, all the keyboard shortcuts are shown as below.

Web Page Showing Keyboard Shortcuts

Try this trick and experience smart and efficient browsing.

Email this article

Written by on Tuesday, July 13th, 2010

    Add Your Comment

    All Comments are Moderated.

    YOUR COMMENT

    About This Site

    Ampercent is a technology blog on computer tutorials, software guides, how to tricks and web tools. The blog is updated daily and written by two computer science students from India. Read More »

    Tip Us »

    Have a great tip which you want to share with fellow readers? Send in your ideas to tips@ampercent.com