Home HTML Attributes frameborder HTML frameborder Attribute Definition
Definition and Usage The frameborder attribute shows or hides the border around an <iframe> (and historically a <frame> ). Value 1 draws a border (default); value 0 removes it.
It is presentational. For new pages, control the look with CSS border — for example border: none instead of frameborder="0".
Deprecated. Do not use frameborder in new pages. Prefer CSS. Browsers still honor it on many iframes for old content.
Not the table frame attribute. frame on <table> picks which outer table sides are drawn. frameborder only toggles an iframe/frame border.
Syntax
HTML Syntax <iframe frameborder=" 0 | 1 ">
Always give the iframe a meaningful title for accessibility.
Values
Attribute Values Two numeric values:
Value Description Try it 1Draw a border around the frame (default) Try it0No border. Prefer CSS border: none Try itCSS replacement border: none or a custom border style Try it
Try it
Live Preview Toggle frameborder on a demo iframe. Prefer CSS in real projects.
Code
HTML Examples Legacy snippets for study, plus a CSS replacement. Use Try It Yourself for a live editor.
1. Border on 2. Border off 3. CSS replacement Example 1 — frameborder="1" (Legacy) Default behavior: a visible border around the iframe.
<iframe
src="/html"
title="HTML section"
width="320"
height="120"
frameborder="1">
</iframe> How It Works frameborder="1" requests a border around the frame.Default is also 1 if the attribute is omitted.title names the embed for assistive technology.Prefer CSS if you want a custom border style or color.Example 2 — frameborder="0" (Legacy) Common old pattern for a “borderless” embed.
<iframe
src="/html"
title="HTML section"
width="320"
height="120"
frameborder="0">
</iframe> How It Works frameborder="0" asks the browser not to draw a frame border.Still an iframe — only the border chrome changes.Some UAs may still show a faint outline; CSS is more reliable.Replace with border: none in modern CSS.Example 3 — Modern CSS Replacement Same borderless look without the deprecated attribute.
<style>
iframe.embed {
border: none;
width: 100%;
max-width: 320px;
height: 120px;
}
</style>
<iframe
class="embed"
src="/html"
title="HTML section">
</iframe> How It Works No frameborder in the markup.border: none removes the border via CSS.Easy to restyle — color, radius, or shadow without HTML changes.Keep title for accessible naming of the embed. Edge Cases & Pitfalls Most issues are deprecated usage or mixing up similar attribute names.
deprecated Do not use in new UI Presentational attributes are superseded by CSS. Keep frameborder only when reading or patching old pages.
vs Not table frame frame on tables controls outer border sides. Different attribute, different element.
css CSS wins for consistency User-agent default iframe borders vary slightly. Explicit border styles are more predictable across browsers.
a11y Always set title Border or not, an iframe needs an accessible name via title.
script IDL name is frameBorder In JavaScript the property is camelCase frameBorder. Prefer CSS classes over toggling the attribute.
Compatibility
Browser Support frameborder is a deprecated HTML attribute for iframes (and legacy frames) in the browser. It is not a Node.js, Deno, or Bun API.
✓ Deprecated · Still widely parsed
frameborder Still recognized in major browsers for legacy iframes, but marked deprecated. Prefer CSS border for new work.
97% Legacy recognition (approx.)
Google Chrome Supported (legacy)
Supported
Mozilla Firefox Supported (legacy)
Supported
Apple Safari Supported (legacy)
Supported
Microsoft Edge Supported (legacy)
Supported
Opera Supported (legacy)
Supported
Samsung Internet Modern
Supported
Internet Explorer Yes
Supported frameborder Supported · deprecated
Bottom line: Fine for understanding old embeds. Do not rely on frameborder for new designs — use CSS border.
Remember
Key Takeaways Role: 1 shows an iframe border; 0 hides it.
Elements: <iframe> (and legacy <frame>).
Status: deprecated — use CSS border instead.
a11y: always set a meaningful title on iframes.
One line: frameborder toggled iframe borders — replace 0/1 with CSS border today.
Frequently Asked Questions What does the HTML frameborder attribute do? On an iframe (and historically on frame), frameborder="1" draws a border around the frame and frameborder="0" removes it. The default is 1.
Is frameborder deprecated? Yes. MDN lists it among deprecated iframe attributes. Prefer the CSS border property to show or hide the border.
What replaces frameborder="0"? Use CSS such as iframe { border: none; } or border: 0.
Which elements used frameborder? Primarily iframe. Legacy frameset documents also used it on frame elements.
Is frameborder the same as the table frame attribute? No. Table frame chooses which outer table sides are drawn. frameborder toggles an iframe/frame border on or off.
Should I use frameborder in new projects? No. Learn it for older markup. Style iframes with CSS borders instead.
Next: headers Associate table cells with header cells using the headers attribute.
headers tutorial → About the author Developer, cloud engineer, and technical writer
I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.
8 people found this page helpful
Helpful Share Copy link Suggestion