Answers for "html5 crop image"

-1

how to crop an image in html

<head>
<style>
.crop {
  width: 200px;
  height: 150px;
  overflow: hidden;
}

.crop img {
  width: 400px;
  height: 300px;
  margin: -75px 0 0 -100px;
}
</style>
</head>
<body>
  	<!-- This is an image that exists online -->
	<div class="crop">
        <img src="https://i.stack.imgur.com/wPh0S.jpg" alt="Donald Duck">
    </div>
</body>
Posted by: Guest on July-09-2021

Browse Popular Code Answers by Language