Answers for "html image crop"

0

style image so it crops

.alligator-turtle {
  object-fit: cover;
  object-position: 100% 0;

  width: 300px;
  height: 337px;
}
Posted by: Guest on July-15-2020
-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