English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The border attribute specifies the width of the border around the image. By default, images have no border.
With3Image with thick border:
!DOCTYPE html <html> <head> <title>HTML:<img> border attribute - 基础教程网 oldtoolbag.com</title> <body> <img src="haha.gif" alt="haha face" width="42" height="42" border="3"> </body> </html>Test and see ‹/›
IEFirefoxOperaChromeSafari
The border attribute is deprecated, but still supported in all major browsers.
HTML5 The <img> border attribute is not supported. Please use CSS instead.
In HTML 4.01 In this example, the <img> border attribute is deprecated.
The border attribute specifies the width of the border around the image.
Note:By default, images do not have a border (unless the image is in <a> inside the element).
In HTML 4.01 In this example, the <img> border attribute is deprecated. Please use CSS instead.
CSS Syntax: <img style="border:5px solid black">
In our CSS tutorial, you can find more about border attribute. Details.
<img border="pixels">
Value | Description |
---|---|
pixels | Border width in pixels. |