1
I’m using the property clip
in a tag to cut at the bottom of it, however this image will be dynamic, the width size is fixed but the height size will be dynamomic.
So if I have an image with height: 1000px;
and the property clip-path: inset(0px 0px 10px 0px);
will cut 10px from the bottom of the image.
But I need to cut 100% from the bottom of the image if the height is greater than 542px.
No matter the height size the image will always stay at the size of 542px due to cropping.
Because if I determine a fixed size with CSS in the image it ends up being flattened.
Place
object-fit:cover
in the style of the img tag, so you can set the size and the image is not flattened. That property kind of makes theimg
behave like abackground-image
ai vc can put the heig she does not flatten. If you solve your problem tell me that I make an answer with more details– hugocsl
@hugocsl without success.
– Eduardo Mendonça
Guy puts his code in HTML/CSS so we can simulate this problem. Only with the report do not help much more...
– hugocsl
@hugocsl, error in failure, typed wrong property, worked using Object-fit:cover. Thanks <3
– Eduardo Mendonça
Eduardo made a slightly more complete reply with source and reference link, so you can leave it as solved if it solved your problem. So it is not listed as unresolved open question.
– hugocsl