SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard
    Join Date
    Jan 2005
    Location
    blahblahblah
    Posts
    1,447
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    .svg for an icon: bad idea?

    Hello,

    I'd like a .svg image as an icon image. I work with dys- kids, and icons are very useful. Also, sometimes, we have to zoom on the page. .png gets all blurry. Enters a .svg image.

    Good idea? Bad idea? Pros and cons?

    Regards,

    -jj.

  2. #2
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    It depends upon native browser support on the whole I would suspect plus usually SVG is embedded via the OBJECT though you could always have PNG fall-back. So file size might be the other issue. It depends upon how you want to use this icons too, for example are they interactive?

  3. #3
    SitePoint Wizard
    Join Date
    Jan 2005
    Location
    blahblahblah
    Posts
    1,447
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, they're not interactive.
    xhtmlcoder, I must admit that I wouldn't know how to embed via the object tag. Would you be kind enough to post some code?
    Also, how would you set up a fall back?

    Regards,

    -jj.

  4. #4
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    You can also embed SVG in XHTML using XML namespaces but the generic OBJECT method for a SVG object would be something loosely like the following using the typical standard OBJECT attribute values.

    Code:
        <object data="example.svg" width="200" height="200" type=
        "image/svg+xml">
          <img src="example.png" alt="Example Fallback image" />
        </object>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •