SVG foreignObject not showing in Chrome
问题 I have an SVG element with a foreignObject which contains a div. Then in my js I do this: $("#wrapper>svg>foreignObject>div").sparkline(data); which creates a canvas within the div. When I look at the firebug html code for the two browser are: Firefox: <svg> <foreignObject width="20" height="20" x="10" y="-10"> <div> <canvas style="display: inline-block; width: 18px; height: 19px; vertical-align: top;" width="18" height="19"></canvas> </div> </foreignObject> </svg> Chrome: <svg>