MDN will be in maintenance mode on Wednesday September 20th, starting at 10 AM Pacific / 5 PM UTC, for about 1 hour.

我們的志工尚未將本文翻譯為 正體中文 (繁體) 版本。加入我們,幫忙翻譯!
您也可以閱讀本文的 English (US) 版本。

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.

This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

<spacer> is an obsolete HTML element which allowed insertion of empty spaces on pages. It was devised by Netscape to accomplish the same effect as a single-pixel layout image, which was something web designers used to use to add white spaces to web pages without actually using an image. However, <spacer> no longer supported by any major browser and the same effects can now be achieved using simple CSS.

Firefox, which is the descendant of Netscape's browsers, removed support for <spacer> in version 4.


Like all other HTML elements, this element supports the global attributes.

This attribute determines type of spacer. Possible values are horizontal, vertical and block.
This attribute can be used for defining size of spacer in pixels when type is horizontal or vertical.
This attribute can be used for defining width of spacer in pixels when type is block.
This attribute can be used for defining height of spacer in pixels when type is block.
This attribute determines alignment of spacer. Possible values are left, right and center.


<span>Just a text node</span>
<spacer type="horizontal" size="10"></spacer>
<span>Just another text node</span>
<spacer type="block" width="10" height="10"></spacer>


Not part of any specification.

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic Support No No1 — 4 No No No
FeatureAndroidChrome for AndroidEdge mobileFirefox for AndroidIE mobileOpera AndroidiOS Safari
Basic Support No No No1 — 4 No No No


 此頁面的貢獻者: teoli, Sheppy, kscarfone, tregagnon, jswisher, avsaro
 最近更新: teoli,