W3cubDocs

/CSS

-ms-accelerator

Non-standard
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

The -ms-accelerator CSS property is a Microsoft extension that sets or retrieves a string indicating whether the object represents a keyboard shortcut.

Initial value false
Applies to all elements
Inherited no
Media visual
Computed value as specified
Animation type discrete
Canonical order the unique non-ambiguous order defined by the formal grammar

Syntax

/* The object is not a keyboard shortcut (the default) */
-ms-accelerator: false
/* The object is a keyboard shortcut */
-ms-accelerator: true

Values

false

The object is not a keyboard shortcut.

true

The object is a keyboard shortcut.

Formal syntax

false | true

Examples

This example uses the -ms-accelerator attribute in a <u> element to specify that the "N" in the <label> element is a keyboard shortcut. When the option to "Hide keyboard navigation indicators until I use the Alt key" is enabled in the user's Display Properties, the "N" is not underlined until the user presses the Alt key. When Alt + N is pressed, the <input> element that defines an accesskey attribute value of "N" receives the focus.

<!DOCTYPE html>

<html>
  <head>
    <title>Accelerator</title>
  </head>
  <body>
    <label for="oName"><u style="-ms-accelerator: true; accelerator: true">N</u>ame: </label>
    <input type="text"
      id="oName"
      size="25"
      accesskey="N"
      value="Your name here" />
  </body>
</html>

Specifications

Not part of any specification.

Remarks

This property is supported by Windows 2000 and later. It enables users to hide navigation indicators for menu items and controls until the Alt key is pressed.

An access key is a single character used as a keyboard shortcut for selecting an object. The user presses the Alt key and holds it while pressing the character to move input focus to the object, and to invoke the default event associated with the object.

In Internet Explorer 8 (IE8) the -ms-accelerator attribute is an extension to CSS, and can be used as a synonym for acceleratorin IE8 Standards mode.

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/-ms-accelerator