I have SVG icons in the CSS of my webpage. They show and are responsive in Chrome and Safari, but do not show at all in Firefox. Is the problem in the way that I link to the SVGs with content:url
and is there a workaround?
CSS:
#about-linked{
content:url('./info.svg');
position: absolute;
background-color: rgba(24, 24, 24, 0.0);
z-index: 10;
border-radius: 5px;
bottom: 1%;
left: 1%;
height: 35px;
width: 35px;
opacity: 0.7;
display: none
}
#about-linked:hover{
cursor: pointer;
opacity: 0.9;
}
#changeLayer{
content:url(https://cdn1.iconfinder.com/data/icons/pixel-perfect-at-16px-volume-1/16/5049-512.png);
position: absolute;
background-color: rgba(24, 24, 24, 0.0);
z-index: 3;
border-radius: 5px;
top: 10%;
left: 26%;
height: 35px;
width: 35px;
opacity: 0.7;
}
HTML:
<div id='map'>
<div id='program_title'>
<span id="myspan">TITLE</span>
</div>
<div id ='about-linked'></div>
</div>
<div id='changeLayer'></div>
NOTE: changing to content
to background-image
produces and undesirable pattern as opposed to an icon: For example (in Chrome) with content:
, I get:
but with background-image:
I get: