add svg to background css code example

Example 1: set svg background color css

/* You can use CSS masks, With the 'mask' property, you create a mask that is applied to an element. */
background-color: red;
-webkit-mask-image: url(icon.svg);
mask-image: url(icon.svg);

Example 2: css for svg

/* the following css properties are allowed to use in svg */
alignment-baseline, baseline-shift, clip-path, clip-rule, color,
color-interpolation, color-interpolation-filters, color-rendering,
cursor, direction, display, dominant-baseline, fill-opacity, fill-rule, 
filter, flood-color, flood-opacity, font-family, font-size, 
font-size-adjust, font-stretch, font-style, font-variant, font-weight, 
glyph-orientation-horizontal, glyph-orientation-vertical, 
image-rendering, letter-spacing, lighting-color, marker-end, marker-mid, 
marker-start, mask, opacity, overflow, paint-order, pointer-events, 
shape-rendering, stop-color, stop-opacity, stroke, stroke-dasharray, 
stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, 
stroke-opacity, stroke-width, text-anchor, text-decoration, 
text-overflow, text-rendering, unicode-bidi, vector-effect, visibility, 
white-space, word-spacing, writing-mode

Tags:

Html Example