| Depr. | Version |
|---|---|
| Yes | HTML 4.01 |
| IE5.5+ | FF1+ | SA1.3+ | OP9.2+ | CH2+ |
|---|---|---|---|---|
| Full | Full | Full | Full | Full |
Syntax
Description
Depending on the design and
colors used on the page that contains the iframe, it
may not be immediately obvious that the content in the
iframe is from another source (although that may
actually be the desired outcome!). In order to make it absolutely clear,
you may want to use the frameborder attribute which
will cause the browser to render a visual delineation (most likely as a 3D
or bevelled border, but it very much depends on the style of the browser
that you use). A better solution, however, is to use CSS to apply the
border style (it will give you more choice that ‘gray, dull and ugly’,
too!).
Example
The header frame is given a frame border, the main window has no border:
<iframe src="iframe-content.html" height="200" width="200" frameborder="1"> <p>Your browser does not support iframes. That kinda sucks, eh?</p> </iframe>
Value
The HTML specification says to use
"1" to signify ‘border on’ and "0"
for ‘border off’, but some browsers will also honor values of
"yes" and "no".
Compatibility
| Internet Explorer | Firefox | Safari | Opera | Chrome | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 5.5 | 6.0 | 7.0 | 8.0 | 1.0 | 1.5 | 2.0 | 3.0 | 3.5 | 1.3 | 2.0 | 3.1 | 4.0 | 9.2 | 9.5 | 10.0 | 2.0 |
| Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full |
Every browser listed supports this attribute.
User-contributed notes
There are no comments yet.
Add a note
To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.