border (HTML attribute)

Spec
Depr. Version
Yes N/A

Syntax

border="width in pixels or percentage"

Description

By default, an embed will have no border around it. The border attribute rectifies this, and allows you to set a border specified in pixel width. Depending on the browser, the border will either be black or will match the color of the document’s text.

Figure 1. An embed element (a jpg image) with a border thickness of 20 pixels An embed element (a jpg image) with a border thickness of 20 pixels

Example

The border attribute on an image set to "20":

<embed src="giant-grasshopper.jpg" border="20"
height="206" width="300"></embed>

Value

A number representing the width of the border in pixels.

Compatibility

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

Generally, browsers supported the border attribute for this element better when the type of content embedded was an image (Firefox correctly applied a border, as did Safari 2, while the newer Safari 3 did not apply a border; Opera did not apply as border to an image embed, nor did Internet Explorer. None of the browsers applied a border to the embed when the content of the embed was a Flash movie. In short - it’s a very hit and miss affair, mostly miss.

User-contributed notes

There are no comments yet.

Related Products