首页 > 解决方案 > SVG G Path Not Displaying

问题描述

I found this SVG code online, actually, it's from an icon-set that is freeware to download.

    <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000" xml:space="preserve">
                        <metadata> Svg Vector Icons : http://www.onlinewebfonts.com/icon </metadata>
                        <g><g transform="translate(0.000000,511.000000) scale(0.100000,-0.100000)"><path d="M1880.1,4780.3v-220.1H5000h3119.9v220.1v220.1H5000H1880.1V4780.3z"></path><path d="M999.6,3880.7v-220.1H5000h4000.4v220.1v220.1H5000H999.6V3880.7z"></path><path d="M100-780v-4000.4h4900h4900V-780v4000.4H5000H100V-780z M9455.9-793.4l3.8-3565.9H5000H540.2V-803c0,1956.2,5.7,3564,13.4,3569.7c5.7,7.7,2011.7,11.5,4454,9.6l4442.5-5.7L9455.9-793.4z"></path><path d="M5957,1189.5C5530.2,1086.2,4912,935,4584.6,854.6l-599.1-145.5V-745.6c0-1376.2-1.9-1452.8-32.5-1443.2c-166.5,51.7-371.3,61.2-513,22.9c-394.3-105.3-616.3-402-518.7-694.8c124.4-377.1,712-380.9,1083.4-7.6c189.5,189.5,179.9,103.3,191.4,1588.7l9.6,1292l1167.6,292.8C6016.4,466,6546.6,596.2,6556.1,598.1c7.7,0,13.4-478.5,13.4-1062.3s-3.8-1062.3-7.7-1062.3c-5.7,0-32.5,9.6-61.2,19.1c-116.8,45.9-333.1,57.4-459.4,28.7c-409.6-95.7-647-388.6-560.8-692.9c30.6-112.9,149.3-237.3,258.4-269.9c132.1-38.3,333.1-28.7,478.5,23c243.1,88,398.1,225.8,501.5,446l51.7,111l5.7,1623.1c3.8,1305.4,0,1621.2-19.1,1619.3C6743.7,1380.9,6383.9,1294.8,5957,1189.5z"></path></g></g>
                        </svg>

For some unknown reason, I cannot get it to display.

标签: htmlcsssvg

解决方案


width="100" height="100" stroke="blue" fill="purple" stroke-width= '5' These are missing.add them like this:

......

You are good to go.
edit::::in css::

svg {
 height: 1 rem;
 width: 1 rem;
 stroke: #xxx;
 fill: #xxx;
 stroke-width: 5;
}

推荐阅读