To center SVG, add the following CSS:
# svgelem { margin-left:auto; margin-right:auto; display:block; }
The following is our SVG:
<svg id="svgelem" height="200" xmlns="https://www.w3.org/2000/svg"> <circle id="redcircle" cx="50" cy="50" r="50" fill="red" /> </svg>