Easy Tutorial
❮ Tag Thead Att Meta Name ❯

HTML <img> border Attribute

HTML <img> Tag

Example

Image with a 5-pixel thick border:


Browser Support

All major browsers support the border attribute.


Definition and Usage

In HTML 4.01, the border attribute of <img> is deprecated.

The border attribute specifies the width of the border around the image.

Note: By default, images have no border unless they are inside an <a> element.


Compatibility Notes

In HTML 4.01, the border attribute of <img> is deprecated. Use CSS instead.

CSS syntax: <img style="border:5px solid black">

CSS Example: Image Border

In our CSS tutorial, you can find more details about the border property.


Syntax

Attribute Values

Value Description
pixels The width of the border, in pixels.

❮ Tag Thead Att Meta Name ❯