HTML Element Style How to - Add border to Image to create rounded border








Question

We would like to know how to add border to Image to create rounded border.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
img {<!-- ww w.j av a 2s.  c  om-->
  box-shadow: 0 0 0 10px black;
  border-radius: 100%;
}
</style>
</head>
<body>
  <img
    src="http://www.java2s.com/style/download.png" />
</body>
</html>

The code above is rendered as follows: