Skip to: content, navigation

border (HTML attribute)

Spec
Depr. Version
Yes HTML 4
Browser support (more…)
IE5.5+ FF1+ SA1.3+ OP9.2+
Full Full Full Full

Syntax

border="number"

Description

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

Example

This border attribute is set to "10":

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

Value

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

Compatibility

Internet Explorer Firefox Safari Opera
5.5 6.0 7.0 1.0 1.5 2.0 1.3 2.0 3.0 9.2 9.5
Full Full Full Full Full Full Full Full Full Full Full

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

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.

Related Products

Search