Is Svg a Block Level Element?
Contents

The reason for this is nicely explained in a StackOverflow post like this: inline or inline-block elements are called “inline” because they are intended to be laid out amongst lines of text.

Is SVG a block element?

Just as an image there is space below a svg. Because they are, by default, inline-block elements (inline in some browsers). As such, they sit alongside text: the space that’s visible under an svg is there for descenders on letters like ‘p’ and ‘q’. This can be seen by placing a svg within a div.

Is SVG a DOM element?

SVG is a language for describing 2D graphics in XML. … SVG is XML based, which means that every element is available within the SVG DOM. You can attach JavaScript event handlers for an element.

Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article
Twitter Facebook Pinterest