HTML <spacer> Tag

The <spacer> element is used to insert empty spaces on the web page both horizontally and vertically.

Modern browsers don’t support the <spacer> tag.Use HTML <pre> and <br> tags, or CSS margin and padding properties instead.

Syntax

The <spacer> tag is an empty element; the closing tag </spacer> isn’t required.

Example

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document </title>
  </head>
  <body>
    <div style="display: block; text-align: center;">
      PageUp↑
      <br>
      ←Home
      <spacer type="block" width="100" height="100" align></spacer>
      End→
      <br>
      PageDown↓
    </div>
  </body>
</html>

Result

Attributes

Attribute Value Description
align align Defines the alignment of the element relatively to the content.
height height Defines the height of an empty space in pixels.
size size Defines the pixel number of an empty space, depending on the type attribute.
type block
horizontal
vertical
Indicates the element type.
width width Defines the width of an empty space in pixels.

The <spacer> tag supports the Global Attributes and the Event Attributes.

Browser support