已废弃
该特性已经从 Web 标准中删除，虽然一些浏览器目前仍然支持它，但也许会在未来的某个时间停止支持，请尽量不要使用该特性。

fixed()方法创建了一个<tt>标签元素将字符串包裹起来，从而让这个字符串里面的内容具有固定间距。

## 语法

    str.fixed()

### Return value

返回一个表示 `<tt>` HTML 元素的字符串。

## 描述

`fixed()` 方法将一个字符串包裹在<tt></tt>标签中，比如: `"<tt>str</tt>"`.

## 举例

### 使用fixed()

下面的示例代码使用这个fixed方法来改变字符串的格式：

    var worldString = 'Hello, world';
    console.log(worldString.fixed()); // "<tt>Hello, world</tt>"

## 说明

Specification | Status | Comment
--- | --- | ---
ECMAScript 2015 (6th Edition, ECMA-262) String.prototype.fixed | Standard | Initial definition. Implemented in JavaScript 1.0. Defined in the (normative) Annex B for Additional ECMAScript Features for Web Browsers.
ECMAScript Latest Draft (ECMA-262) String.prototype.fixed | Draft | Defined in the (normative) Annex B for Additional ECMAScript Features for Web Browsers.

## 浏览器兼容性

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

- Desktop
- Mobile

版本 | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari
--- | --- | --- | --- | --- | ---
Basic support | (Yes) | 1.0 (1.7 or earlier) | (Yes) | (Yes) | (Yes)

版本 | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile
--- | --- | --- | --- | --- | --- | ---
Basic support | (Yes) | (Yes) | 1.0 (1.0) | (Yes) | (Yes) | (Yes)

## 相关链接

- `String.prototype.bold()`
- `String.prototype.italics()`
- `String.prototype.strike()`