HTML
The border attribute
Example
An image with a 5-pixel thick border:
Try it »
Browser support





All major browsers support the border attribute.
Definition and Usage
HTML5 does not support The border attribute. Use CSS instead.
In HTML 4.01, The border attribute is deprecated.
The border attribute specifies the width of the border around the image.
**Note:** By default, images have no border (unless the image is inside the element).
Compatibility notes
In HTML 4.01, The border attribute is deprecated. Use CSS instead.
CSS syntax:
In our CSS tutorial, you can find more details about The border attributedetails.
Syntax
Attribute values
| Value | Description |
|---|---|
| pixels | The width of the border, in pixels. |
HTML tag