Important SVG elements

To demonstrate each element, we'll use the following code as a starting point and then add each element inside the <svg> tag:

<!DOCTYPE html>
<html lang="en" dir="ltr">
    <head>
    </head>
    <body>
        <svg width=800 height=600>
        </svg>
    </body>
</html>

Let's now move on to each element. Note that you can write each tag in the form <element></element>, as we did with <circle></circle> previously, or the self-closing form, <element/>, which you will see next with <circle/>.

Get D3.js Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.