Grow your CSS skills. Land your dream job.

Right way to put SVG code directly into HTML?

  • # February 9, 2013 at 10:19 pm

    As SVG tag is not recommended by W3C with what tag you should wrap SVG code in HTML? Though all modern browsers render it perfectly valid document is a right way to go. :)

    # February 10, 2013 at 4:22 am

    If you’re not using the svg element can you actually USE svg code?

    Anyway, from my reading every web browser supports SVG except Internet Explorer versions 8 and older.

    # February 10, 2013 at 12:02 pm

    There should be of course SVG element(don’t know will it work without), i wished to ask with what element you should wrap SVG element. Like OBJECT…?

    Document didn’t pass validation in Brackets with JSLint. Now I did validation in http://html5.validator.nu/
    and he says “The document is valid HTML5 + ARIA + SVG 1.1 + MathML 2.0″.

    All modern browsers do support it perfectly and i have no concerns for older browsers, they are pretty much dead for me. Well XP users on IE8 are only concern, but also i think that “right” users on XP use Chrome or Firefox.

    So i guess it’s fine too use SVG element without OBJECT…

    # February 10, 2013 at 2:31 pm

    JSLint will reject all sorts of things that are fine…I wouldn’t worry about it.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".