Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8168195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:26:26+00:00 2026-06-06T20:26:26+00:00

I have SVG documents which I display directly in browsers (currently IE and Firefox)

  • 0

I have SVG documents which I display directly in browsers (currently IE and Firefox) – by loading the *.svg directly into the browser. These documents contain text which I would like to display as “HTML”, e.g. rendered in an HTML window/panel with word-wrap, subscripts and possibly scrolling. The SVG and HTML are well formed and managed under the correct namespaces.

A typical sort of element (without styles) might be:

<svg  xmlns="http://www.w3.org/2000/svg">
  <g>
    <rect x="100" y="200" width="300" height="400"/>
    <h:p xmlns:h="http://www.w3.org/1999/xhtml">
This is an <h:i>italic</h:i> and a <h:sub>subscript</h:sub> in a ...
very long ... paragraph which will need word wrapping and maybe scrolling
    </h:p>
  </g>
</svg>

It would be nice to be able to locate the text within a given bounding box (e.g. the <rect/>)

Note that at present I do not want to embed SVG within an HTML document and there is no need for recursion (e.g. no SVG within the HTML).

UPDATE:
Encouraged by @Sirko I found this article on the web it’s 4 years old.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T20:26:28+00:00Added an answer on June 6, 2026 at 8:26 pm

    In general the <foreignObject> shall be used for including different markups inside of SVG (see MDN docu on this). In your case this other markup would be XHTML.

    <svg  xmlns="http://www.w3.org/2000/svg">
      <g>
        <rect x="100" y="200" width="300" height="400" style="fill: none; stroke: black; stroke-width: 1px;"/>
        <foreignObject x="100" y="200" width="300" height="400">  
          <!-- XHTML content goes here -->  
          <body xmlns="http://www.w3.org/1999/xhtml">  
            <p>
                This is an <i>italic</i> and a <sub>subscript</sub> in a ...
                very long ... paragraph which will need word wrapping and maybe scrolling
            </p>
          </body>  
        </foreignObject>  
    
      </g>
    </svg>
    

    This, however, has quite some compatibility problems between the major browsers!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have an inline svg with foreignObject elements which contain xhtml fragments. however, the
I have an SVG file embedded into an HTML document inside . I can
I have a web app which plots points with SVG, I want to add
I have a function that loads a SVG Dom from a file. Currently, it
I have an SVG element in which I have made a foreignObject. The foreignObject
I have a few svg documents with a 1-n Path elements now i wanted
I have a div element which contains a svg graph (bunch of circles and
I have an SVG which has multiple path elements contained within a group (it's
I have a SVG object (generated with RaphaelJS) which shows correctly when inserted in
I have an svg group which contains some elements, I want to clone the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.