I am using for the first time the svg <image> tag. I use this tag in order to apply a gray filter on the picture (thank you IE).
Here is my HTML :
<div class="container">
<div class="item">
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg">
<image xlink:href="https://dummyimage.com/400x400/000/00ffd5.png" />
</svg>
</div>
</div>
And the scss :
.item {
position: relative;
width: 20%;
height: 220px;
background-color: blue;
}
svg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
image {
width: 100%;
height: 100%;
}
}
I want to fit the image to the parent's container. Something like background: cover in css. Does anybody have an idea ?
You can check it out at : https://codepen.io/seabon/pen/QvBBrd
The blue background is for div.item
