The <spacer> element was a Netscape-only way to insert empty horizontal, vertical, or block gaps — a substitute for single-pixel spacer GIFs before CSS layout was common.
Study it only as web history. For real spacing today, use margin, padding, or gap with display: flex / grid. Prefer meaningful structure ( <p>, <div>, sections) over empty layout tags.
Obsolete & non-standard.
Never part of HTML standards. Listed in the WHATWG obsolete elements. No major browser applies spacing from <spacer> today.
Use instead.
CSS margin / padding for box spacing; gap for flex and grid. Avoid empty <div>s when a margin on existing content is enough.
Syntax
HTML Syntax
syntax.html
<spacer type="horizontal" size="10">
Historical markup was empty (no useful content). Modern engines treat it as an unknown element — no gap appears.
Reference
Attributes
Historical attributes (all ineffective in current browsers):
No empty <spacer> (or empty div) required between children.
Same idea for grids with display: grid and gap.
Edge Cases & Pitfalls
Most “bugs” are expecting Netscape-era gaps in modern engines.
obsolete
Never use in new pages
Validators and the HTML Living Standard treat spacer as author-forbidden. Replace on sight.
silent
Looks like markup, does nothing
Unknown elements may still appear in the DOM inspector while producing zero layout effect — easy to miss in reviews.
a11y
Empty tags are not structure
Spacing is presentation. Use headings, lists, and landmarks for meaning; CSS for distance.
migration
Do not swap for empty divs
A bare <div style="height:40px"> repeats the same anti-pattern. Prefer margin/gap on real content.
history
Not the same as CSS spacer utilities
Framework “spacer” classes are CSS helpers. The HTML <spacer> element is a dead Netscape tag.
Compatibility
Browser Support
The <spacer>element is obsolete and unsupported. Spacing belongs to CSS.
✓ Obsolete · Non-standard
<spacer>
Netscape-only in the 1990s. Never standardized. Firefox removed it early; Chrome, Safari, Edge, and Opera do not implement spacer layout. Use margin, padding, or gap.
0%Modern support for <spacer>
Google ChromeNever
Unsupported
Mozilla FirefoxRemoved (legacy)
Unsupported
Apple SafariNever
Unsupported
Microsoft EdgeNever
Unsupported
OperaNever
Unsupported
Samsung InternetNever
Unsupported
<spacer> elementUnsupported
Bottom line: Do not use <spacer>. CSS margin, padding, and gap work everywhere that matters.
Remember
Key Takeaways
Status:<spacer> is obsolete Netscape markup — never use it.
Replace with:margin, padding, or flex/grid gap.
Attributes:type, size, width, height, align are historical only.
Structure first: space real content; avoid empty layout tags.
One line: skip <spacer>; control distance with CSS on meaningful HTML.
UA style
Default CSS Settings
Unknown elements like obsolete spacer typically display inline with no special size:
default.css
spacer {
display: inline;
}
There is no user-agent stylesheet that recreates Netscape type/size gaps.
Frequently Asked Questions
Netscape introduced spacer to insert empty horizontal, vertical, or block gaps without a spacer GIF image. It was a proprietary layout helper from the mid-1990s.
No. It was never standardized. Firefox (Netscape’s successor) dropped it long ago, and current browsers ignore it for spacing.
Only as an obsolete element authors must not use. The WHATWG obsolete section says to use appropriate elements or CSS instead.
Use CSS margin or padding for spacing around elements, and gap for flex or grid layouts. Prefer real structure (paragraphs, lists, sections) over empty spacer tags.
type was horizontal, vertical, or block. size set pixel length for horizontal/vertical. For block, width and height set the empty rectangle; align could be left, right, or center.
You may see it in very old pages or archives. Recognizing it helps you replace dead markup with CSS quickly.