Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Bear in mind that SVGs CAN be embedded within HTML so you can have ``` <p> <svg><circle></svg> Some content <svg><rectangle></svg> </p> ```

These elements are valid parts of DOM and the events on them trigger within scope of HTML DOM and not within scope of SVG DOM



Svija SVG's are embedded in HTML — it's necessary to get the page to resize correctly.

We would like to integrate HTML elements wherever possible to display text. This would enable us to preserve semantic content, make accessibility easier, and make text management easier.

The problem is that until we have funding to build our own page editor it's just not feasible. Svija is meant for designers, not coders.


Likewise, SVGs can embed HTML with <foreignObject>. It's DOM trees all the way down


I'm confused by this comment, because I'm not sure how else they would be included in a webpage


Not sure what they meant, but my only guess is they mean via an img tag.

  <img src="some.svg">


Yup. You can also do <svg src="some.svg"/>

But I was talking about embedding which is, I think much nicer.

The only difference between both cases I was able to find is that if SVG is loaded via src, it will be a separate `document`. If it's embedded, it's part of DOM tree of HTML document that is being viewed.


Derp.. I've been rendering svgs in JSX for so long, I forgot about the obvious things like <img>, <link>, even adding an svg in CSS with background-image




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: