Is there a way to display an image in a CSS :before
element?
.withimage:before {
content: url(path/to/image.svg);
display: block;
height: 20px;
width: 20px;
}
I'm facing an issue where the height
and width
properties are applied to the element, but the SVG image does not scale down accordingly. How can I ensure that these sizes are actually applied to the element created by before?
Check out this Plnkr example for reference: https://plnkr.co/edit/UgryaObojs6PCU579oGY