Prev

Images

Other Image Attributes

Note: Ideally HTML should be used to change how a page is organized, not how it looks. These image attributes are still widely used but the best web authors use another technology, called CSS, which stands for Cascading Style Sheets, to do the same things.
You may have already guessed, but src is not the only attribute that the <img /> tag can understand. Several that are useful are align, width, height, and border. These attributes help change the way your images look.

The border attribute

Try It: Try putting a border around an image on your page.
The border attribute allows you to give your image a border. The value is the number of pixels wide the border should be. If you want no border, this can be 0. So the following code would make an image with a 4 pixel border:
<img src="flower.gif" border="4" /> is displayed as:

Prev