I want to make an image to fit the content.
Trimming transparent background will be needed if it is done with a photo editor.
Is there any way to deal with CSS?
Or do I have to edit image before using it?
Thanks in advance!
What I have researched about css feature:
- object-fit: It was a little more about aspects
CodePudding user response:
There is no such feature in CSS as far as I can tell.
However, there are two possible solutions fixing your problem.
If it has to be done for an already known image:
- You could manually scale the image using
background-size
andbackground-position
so it does only show the area of the image you need.
If it has to be done for an unknown image: