<div class="class1">
<img src="img/svg/facebook.svg" alt="">
<img src="img/svg/facebook.svg" alt="">
</div>
I was trying to implement this:
.class1 svg {
width: 50px;
height: auto;
}
But it doesn’t work. where am I going wrong?
<div class="class1">
<img src="img/svg/facebook.svg" alt="">
<img src="img/svg/facebook.svg" alt="">
</div>
I was trying to implement this:
.class1 svg {
width: 50px;
height: auto;
}
But it doesn’t work. where am I going wrong?
This:
.class1 svg {
width: 50px;
height: auto;
}
should be:
.class1 img {
width: 50px;
height: auto;
}
Viking-in-chief is a badge of honor or what?
Lol. Ask @fretburner …
Svgs should expand to fill their parent container unless they have the fixed svg width and height parameters set. Therefore apply the class to the div.
The code used the <img>
tag, so the size (given in pixels) can (should) be set via the width
and height
attributes.
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.