How TO – Add a Border to an Image


Previous


Next

Learn how to add a border around an image.




Border Around Image

Use the border property to add a border to an image:

Snow

How To Add a Border to an Image

Use the border property to add a border to an <img> element:

 

Example

<!DOCTYPE html>
<html>
<head>
<style>
img {
border: 5px solid #555;
}
</style>
</head>
<body>

<h2>Border Around Image</h2>
<p>Use the border property to add a border to an image:</p>

<img src=”img_snow.jpg” alt=”Snow” style=”width:150px”>

</body>
</html>

Go to our CSS Images Tutorial to learn more about how to style images.


Previous


Next

Scroll to Top