border (HTML attribute)

Depr. Version
Yes HTML 4
Browser support (more…)
IE8+ FF1+ SA4 OP9.2+ CH2
Full Full None Full None




By default, an object will not have a border around it. The border attribute rectifies this, allowing you to set a border with a width specified in pixels. Depending on the browser, the border will either be black, or will match the color of the text attribute of the body element. An example is shown in Figure 1.

Figure 1. An object displaying with a border thickness of ten pixels An object with a border thickness of 10 pixels


This border attribute is set to "10":

<object data="giant-dog.jpg" border="10"></object>


This attribute takes a number representing the width of the border in pixels.


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
Partial Partial Partial Full Full Full Full Full Full None None None None Full Full Full None

This attribute is poorly supported and highly presentational. CSS should be used to control appearance instead.

User-contributed notes

There are no comments yet.

Related Products