When I insert an image into a container with a fixed width and height, the image is stretched to fit that space. Is there a way to display the image in normal size, but are excessively cut out?
The modern way is to use object-fit: none; (or a more general object-fit: cover; if you want to scale, but without stretching).
object-fit: none;
object-fit: cover;
img { object-fit: cover; }
93% of browser sessions have supported this since 2018. - May I use?
<div style="width: 100px; height: 100px; background-image: url(your image); background-repeat: no-repeat;"></div>
Then in the above div you can play with CSS
to create different crop effects.
You can use the CSS clip property:
clip
#image_element { position:absolute; clip:rect(0px,60px,200px,0px); }
The disadvantage of using clip is that the element must be absolutely positioned and accessible only with the "rect" shape.
Cm:
Show background image
Use this: http://www.w3schools.com/css/pr_background-position.asp
background-position: 5px 5px;
and then set the height and width of the div
height: 55px;
width: 55px;
Source: https://habr.com/ru/post/1306714/More articles:A user interface that allows you to use more than 700 options - user-interfaceIs it possible to export IDE color settings from VS2008 to VS2010? - visual-studio-2008Suppress NSLog applications for release? - objective-cDynamic Selection for Django SelectMultiple Widget - djangoEntity Framework - insert using foreign key - c #Derivative Programs - transformationHow to use an environment variable as the name of an environment variable - environment-variablesHow to rename my asp.net webpage - asp.netChanging nested structures in C # - c #How to limit function functionality - licensingAll Articles