HTML img border Attribute

Definition and Usage

The border attribute specifies the width of the border around an image.
By default, an image will have no border. The border attribute allows set a border and specify the border width in pixels

Compatibility Notes

The border attribute of the img element was deprecated in HTML 4.01 and is not supported in XHTML 1.0 Strict DTD.
Use CSS instead.
CSS syntax: <img style="border:4px solid black"/>


<img border="pixels" />

Syntax Example

<img border="4" />

Attribute Values

Value Description
pixels Specifies the border width in pixels
HTML img border Attribute Reviewed by 1000sourcecodes on 04:27 Rating: 5
Powered by Blogger.