You can use the CSS property clip. If you want to show only the upper left corner squared 50px x 50px, you can do
position: absolute;
clip: rect(0px, 50px, 50px, 0px);
on the background image. As noted, this is deprecated in the comments, but there are other options.
You can use the CSS property clip-path.
-webkit-clip-path: polygon(0 0, 10% 0, 10% 10%, 0 10%);
-moz-clip-path: polygon(0 0, 10% 0, 10% 10%, 0 10%);
-o-clip-path: polygon(0 0, 10% 0, 10% 10%, 0 10%);
clip-path: polygon(0 0, 10% 0, 10% 10%, 0 10%);
10% , , 50px ,
-webkit-clip-path: inset(0 450px 450px 0);
-moz-clip-path: inset(0 450px 450px 0);
-o-clip-path: inset(0 450px 450px 0);
clip-path: inset(0 450px 450px 0);
div crop
<div class="crop>
<img src=""/>
</div>
.
.crop {
width: 50px;
height: 50px;
overflow: hidden;
}
, .crop img.