JSFiddle - React, Tailwind, and code Playground
HTML
<div><img src="http://lorempixel.com/400/200/">
</div>
CSS
img {
position: absolute;
clip: rect(10px, 350px, 170px, 0);
}
div {
margin: 40px auto;
content: "";
position: relative;
left: 0; top: 0;
width: 400px;
height: 200px;
border: 3px dashed royalblue;
}
JavaScript
/*
* I have a 400px (width) by 200px (height) element.
* I want to remove:
* - 50px on the right of the element,
* - 10px on the top,
* - 30px on the bottom.
* Answer: clip: rect(10px, 350px, 170px, 0);
*/