The border attribute of the IMG element adds a border around an image.
<img src="example.gif" alt="Example" border="1">
| Attribute | Value | Explanation |
|---|---|---|
| border=" " | pixels | the size of a border |
The use of this attribute is deprecated. (Use CSS instead)
When an image is used as a link, the browser will automatically display a border of the image.
If you want to rid the image of the border, specify 0 for the value of the border attribute.
<a href="index.html"><img src="image/example.jpg" alt="Example" border="0"></a>
Use CSS instead of deprecated HTML. Please see the "Related Document" for details on CSS.
<p><img src="image/example.jpg" alt="Example"> Default</p> <p><img src="image/example.jpg" alt="Example" border="1"> The border is 1</p> <p><img src="image/example.jpg" alt="Example" border="5"> The border is 5</p>
Default
The border is 1
The border is 5