Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

SVG are vector graphics that can be rendered in all modern browsers:

http://caniuse.com/#feat=svg-img

You do miss out on the recoloring and any other font styling options though.



Actually you can style SVG with CSS

    #yourSVG {
        fill: red;
        stroke: blue;
    }


I don't think you can re-style a SVG with CSS if you embed it with IMG. CSS styling has to be inline with the SVG, so you can embed it directly, or you can change CSS with JS.


mind = blown


The problem is that, until <svg use> is standardized and supported, the only way to style svg elements is if you include them in your markup (or use something like Iconic's SVG Injector).

There's a tradeoff between inlining (or rather, including them server-side) and calling them as <img>, background-image, or fonts. The size, http requests, caching , and styling all play a role.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: