border: ***;

Browser
  • IE
  • Cr
  • Sf
  • Fx
  • O

The border property sets the border of an element.

The border of the image can be specified by applying this property to the IMG element.


img {
border: 2px red solid;
}

Property Value Explanation
border each value sets width, color, and style

Example


<html>
<head>
<title>TAG index</title>

<style type="text/css">

#example { border: 5px red solid; }

</style>

</head>
<body>

<p><img src="image/photo.jpg" alt="Example" width="200" height="133" id="example"></p>

</body>
</html>

Output

Example