Accepted answer

You need to set a height and width of the svg element, then it will show up.


Simple add to the CSS:

    width: 500px;
    height: 300px;

Or add to the HTML:

style width=500px, height=300px


To see things, you need the width and height attributes on the SVG element. And width and height CSS properties on the html and body tags:

<svg id="main" width="100%" height="100%"></svg>

html {
    width: 100%;
    height: 100%;

body {
    background-color: #555;
    width: 100%;
    height: 100%;

Related Query