
"I have CSS code to display SVG files. How to force background as transparent or white? The SVG is already transparent. But SVG files do not contain a background unless one is added in the code or as a shape. An example: @media (min-width: 600px) { .header1 .logo a, .header1 .logo img { background: url(my.svg) left center no-repeat; width: 220px; height: 75px; } }"
"How to force background as transparent or white? The SVG is already transparent. But SVG files do not contain a background unless one is added in the code or as a shape. An example: @media (min-width: 600px) { .header1 .logo a, .header1 .logo img { background: url(my.svg) left center no-repeat; width: 220px; height: 75px; } }"
A CSS snippet uses a media query to set an SVG as a background image on .header1 .logo a and .header1 .logo img with fixed width and height. The SVG file is already transparent. SVG files do not contain a background unless a background shape is added in the SVG markup or included as a separate element. Forcing a visible background can be achieved by applying background-color on the element that hosts the SVG background image. Alternatively, embedding a rect with a fill color inside the SVG will render the image with a nontransparent background.
Read at SitePoint Forums | Web Development & Design Community
Unable to calculate read time
Collection
[
|
...
]