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

  • Home
  • SEARCH
  • 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 6901259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:39:03+00:00 2026-05-27T07:39:03+00:00

I have a SVG object (generated with RaphaelJS) which shows correctly when inserted in

  • 0

I have a SVG object (generated with RaphaelJS) which shows correctly when inserted in one HTML page.

When creating the same SVG using the same code in a different page, text appears incorrectly aligned in vertical.

I have checked all styles and attributes affecting SVG and the HTML containing the diagram, but I haven’t found any significant difference. Also, I thought that SVG should not be affected by the CSS rules of parent HTML elements.

Here is a picture of the issue. On the left, the correctly rendered diagram. On the right, the text appears incorrectly aligned (not centered). These two SVG objects appear in different iframes of the same document (I have put them together for the picture).

SVG text alignment issues

Edit: I have noticed that the Y coordinates of text elements are indeed different:

<!-- Incorrect -->
<text x="362" y="71" text-anchor="end" style="font: normal normal normal 10px/normal Arial; text-anchor: end; " stroke="none" fill="#000000"><tspan>MQ</tspan></text> 
<!-- Correct -->
<text x="362" y="74.5" text-anchor="end" style="font: normal normal normal 10px/normal Arial; text-anchor: end; " font="10px &quot;Arial&quot;" stroke="none" fill="#000000"><tspan>MQ</tspan></text>

Any idea?

  • 1 1 Answer
  • 1 View
  • 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-05-27T07:39:04+00:00Added an answer on May 27, 2026 at 7:39 am

    SVG elements in the same document (which is the case if you use Raphaël) do get CSS applied from its parents, as well as stylerules from stylesheets used in that document that happen to target svg elements.

    Have you tried using a debugging tool such as opera dragonfly, webkit inspector or mozilla firebug to inspect what styles are being applied to those text elements?

    At least the following properties would affect the text baseline:

    • dominant-baseline
    • alignment-baseline
    • baseline-shift
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a php script (generator.php) which generates certain HTML/XML/SVG depending on various conditions.
I have an SVG file inside HTML, and one of the things I've heard
I have an html page with this code <object data=ciao.xhtml width=100% height=100% type=application/xhtml+xml> </object>
I have an SVG image which fits its parent <object> dimensions. The image is
I embedded an SVG object in an HTML page as follows: <embed id=svgImg src=bo5rkbgs5vtsmv053regld2t14.svg
I have got a html page embedded with a .svg. I have written most
We have a big SVG object which we've fragmented into little pieces. Most of
I have an SVG file within an object tag displaying in a table cell,and
I have an object which has a position, a rotation angle and a scale
I have a JSF 2 application which creates some SVG content. How can i

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.