how to crop an image in html

Solutions on MaxInterview for how to crop an image in html by the best coders in the world

showing results for - "how to crop an image in html"
Eric
19 Jan 2020
1<head>
2<style>
3.crop {
4  width: 200px;
5  height: 150px;
6  overflow: hidden;
7}
8
9.crop img {
10  width: 400px;
11  height: 300px;
12  margin: -75px 0 0 -100px;
13}
14</style>
15</head>
16<body>
17  	<!-- This is an image that exists online -->
18	<div class="crop">
19        <img src="https://i.stack.imgur.com/wPh0S.jpg" alt="Donald Duck">
20    </div>
21</body>
similar questions
queries leading to this page
how to crop an image in html