CSS Property Value How to - border: 1px solid black;








Question

We would like to know how to border: 1px solid black;.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.my-div {<!-- w ww .j  av  a2s  .c o m-->
  border: 1px solid black;
  width: 300px;
  height: 200px;
  text-align: center;
}
</style>
</head>
<body>
  <div class="my-div">
    <img src="http://placehold.it/100x50" />
  </div>
</body>
</html>

The code above is rendered as follows: