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 8269071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:06:03+00:00 2026-06-08T06:06:03+00:00

See the problem in action: http://jsfiddle.net/krtGd/1/ I have an embedded SVG element in a

  • 0

See the problem in action: http://jsfiddle.net/krtGd/1/

I have an embedded SVG element in a floating div, something like this:

<div style="float: left;">
    <svg width="50" height="20" id="svg1">           
    </svg>
</div>

This works fine; the div fits as expected around the SVG. However, when I resize the SVG with JavaScript, like so:

$('#svg2').attr('width', 50);

…the SVG resizes properly, but the box around it doesn’t. As you can see in the jsFiddle, the same thing is true if the containing div has display:inline-block instead of a float style.

The weird thing here, and what’s convincing me that this is a reflow problem and not a simple layout problem, is that if you inspect the either of the problem elements in the Chrome console Elements Panel, the div elements resize correctly. This problem may only apply to Google Chrome – I’m seeing it in Chrome OSX v.20.0.1132.57, but not in Safari. I haven’t tested in FF or IE.

So: How can I force reflow in Chrome?

I have tried the usual suspects, including inspecting div.offsetHeight, svg.getBBox(), and several other variants.

  • 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-08T06:06:05+00:00Added an answer on June 8, 2026 at 6:06 am

    Sounds like a bug in Chromium. When the intrinsic width/height of an svg element change, the layout width/height aren’t automatically changing. You can manually set the layout width/height though: .css("width", "50px"). Have you considered filing a bug with Chromium?

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

Sidebar

Related Questions

In this JSFiddle http://jsfiddle.net/JQ6qF/ have I striped down the problem. Try click on Save
Please go to: http://jlecologia.com/page1c.html to see the problem The top box look fine but
i have a little problem and see no solution for it. I need flexible
I have been following http://learn.iis.net/page.aspx/806/seo-rule-templates/ , which is a nearly perfect guide to creating
I have created a clickable div element that has a few links inside it.
I have this code, but when I clone an element, then the action is
I have a simple MVC3 Controller Action like this [HttpGet] [OutputCache(Duration = 1200,Location=System.Web.UI.OutputCacheLocation.Server)] public
I have this problem with the menu floating over the border of the page.
I see this problem on and off again in my PHP coding, and I've
Does anyone see a problem with this, its not working saying bad file descriptor

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.