Adding a Border to an Image

By default, an image is displayed without a border. However, a border can be added to an image y using the border attribute of the <img> tag to specify the width of the border around an image.

Let’s do the following steps to add a border to an image:


<!DOCTYPE html>
<html>
<head>
    <title> Image </title>
</head>
<body>
    <h1>Adding a Border to an Image</h1>
    <p><font color=”darkred” size=”5”> Image without border</font></p>
    <img src=”images\globe.jpg” alt=”Globe Cartoon” />
    <p><font color=”darkred” size=”5”> Image with border</font></p>
    <img src=”image\globe.jpg” alt=”Global Teacher” border=”7” />
</body>
</html>

Save the document with the name ImageBorder.html and open on browser