score:4

Accepted answer

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

score:0

Simple add to the CSS:

#main{
    width: 500px;
    height: 300px;
}

Or add to the HTML:

style width=500px, height=300px

score:1

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