tag:blogger.com,1999:blog-2160921736769720124.post3743044628436742092..comments2023-04-29T05:27:41.501-04:00Comments on Absolutely!: SVG with webpagesmaxolasersquadhttp://www.blogger.com/profile/05885203204831537402noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-2160921736769720124.post-10011755105260062432009-08-13T09:57:50.197-04:002009-08-13T09:57:50.197-04:00I got it working by adding the viewBox attribute t...I got it working by adding the viewBox attribute to the SVG and changing the width and height attributes to 100% in the SVG. Soon I will post in more detail how I got it to work.maxolasersquadhttps://www.blogger.com/profile/05885203204831537402noreply@blogger.comtag:blogger.com,1999:blog-2160921736769720124.post-59815443664098007772009-08-11T01:30:58.675-04:002009-08-11T01:30:58.675-04:00Thanks Brad. I will be very interested in taking ...Thanks Brad. I will be very interested in taking a look at the library for cross-browser SVG. Hopefully tomorrow I'll have time to play with viewBox and get my SVGs scaling properly.maxolasersquadhttps://www.blogger.com/profile/05885203204831537402noreply@blogger.comtag:blogger.com,1999:blog-2160921736769720124.post-32395851275362317992009-08-11T00:53:59.980-04:002009-08-11T00:53:59.980-04:00It's confusing but you need to add the viewBox...It's confusing but you need to add the viewBox attribute onto the root SVG tag inside your file, something like:<br /><br /><svg viewBox="0 0 32 32"><br /><br />This says to always scale the image along those dimensions independent of how it is placed. I believe that should solve the issue for you.<br /><br />Technically the clipping is 'correct' I believe since you don't specify the viewBox. The viewBox controls how an image 'maps' onto the space available to it. I think you can also add the preserveAspectRatio attribute to control how things get stretched (Google to see how to use it).<br /><br />BTW, I'm working with others on a library that brings SVG to IE; it's still in alpha but it we are looking for early testers if you want to see if what you are doing will work on there: http://code.google.com/p/svgwebBrad Neuberghttps://www.blogger.com/profile/03436380878044525337noreply@blogger.com