CSS Property Value How to - margin: 10px 15px 10px;








Question

We would like to know how to margin: 10px 15px 10px;.

Answer


<!DOCTYPE html>
<html lang="en">
<head>
<title>Example of margin shorthand property</title>
<style type="text/css">
p {<!--  w w w. j a v  a  2 s .co m-->
  margin: 50px 100px;
  background: #ffb6c1;
}

img {
  margin: 10px 15px 10px;
}
</style>
</head>
<body>
  <p>
    <img src="http://placehold.it/100x100" alt="Boat">This is a paragraph.
  </p>
  <p>This is another paragraph. Change the margins value to see how
    it works.</p>
</body>
</html>

The code above is rendered as follows: