HTML img border properties
Examples
5 pixels thick border with image:
<img src="smiley.gif" alt="Smiley face" border="5">
try it"
Browser Support
All major browsers support border properties.
Definition and Usage
HTML5 does not support the <img> border property. Use CSS instead.
In HTML 4.01, <img> attribute of the border has been abandoned .
border attribute specifies the width of the border around the image.
Note: By default, the image is no border (unless image <a> internal element).
Compatibility Notes
In HTML 4.01, <img> attribute of the border has been abandoned. Use CSS instead.
CSS syntax: <img style = "border: 5px solid black">
In our CSS tutorial you can find more information about the border attribute details.
grammar
<img border="pixels">
Property Value
值 | 描述 |
---|---|
pixels | 边框的宽度,以像素计。 |
HTML <img> tag