Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

agnos.is Forums

  1. Home
  2. Linux
  3. today i learned: svg files are literally just html code

today i learned: svg files are literally just html code

Scheduled Pinned Locked Moved Linux
linux
58 Posts 37 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • cypherpunks@lemmy.mlC [email protected]

    No, SVG files are not HTML.

    Please change this post title (currently "today i learned: svg files are literally just html code"), to avoid spreading this incorrect factoid!

    I suggest you change it to "today i learned: svg files contain code in an html-like language" or something like that.

    SVG is a dialect of XML.

    XML and HTML have many similarities, because they are both are descendants of SGML. But, as others have noted in this thread, HTML is also not XML. (Except for when it's XHTML...)

    Like HTML, SVG also can use CSS, and, in some environments (eg, in browsers, but not in Inkscape) also JavaScript. But, the styles you can specify with CSS in SVG are quite different than those you can specify with CSS in HTML.

    Lastly, you can embed SVG in HTML and it will work in (modern) browsers. You cannot embed HTML in SVG, however.

    zarkanian@sh.itjust.worksZ This user is from outside of this forum
    zarkanian@sh.itjust.worksZ This user is from outside of this forum
    [email protected]
    wrote on last edited by
    #49

    I remember when XHTML was supposed to replace HTML. Everything was going to be standardized and web designers would run their HTML code against a validator...it was going to be glorious! And of course it never happened, because demanding that all websites conform to the XHTML standard would've broken a lot of websites.

    So, HTML5 ate XHTML's lunch because it was much more forgiving, and...oh yeah, you could watch videos and play games in it, too.

    A ? 2 Replies Last reply
    0
    • zarkanian@sh.itjust.worksZ [email protected]

      I remember when XHTML was supposed to replace HTML. Everything was going to be standardized and web designers would run their HTML code against a validator...it was going to be glorious! And of course it never happened, because demanding that all websites conform to the XHTML standard would've broken a lot of websites.

      So, HTML5 ate XHTML's lunch because it was much more forgiving, and...oh yeah, you could watch videos and play games in it, too.

      A This user is from outside of this forum
      A This user is from outside of this forum
      [email protected]
      wrote on last edited by
      #50

      I fucking learned a whole-ass language for nothing back then because I thought it was the future!, fuck you, XHTML!

      zarkanian@sh.itjust.worksZ ? 2 Replies Last reply
      0
      • A [email protected]

        I fucking learned a whole-ass language for nothing back then because I thought it was the future!, fuck you, XHTML!

        zarkanian@sh.itjust.worksZ This user is from outside of this forum
        zarkanian@sh.itjust.worksZ This user is from outside of this forum
        [email protected]
        wrote on last edited by
        #51

        100% of XHTML will work in HTML5.

        1 Reply Last reply
        0
        • adrianhooves@lemmy.todayA [email protected]

          what the heck!! that is so wild, mind blowing, i know the main difference between raster graphics and vector graphics was the quality but not more, i had no idea svg files actually used html code and pretty much could be modified using only text and amazing code woa!!! this opens up the possibility for so many things on linux i think, for example, on a linux distro, we could modify the desktop environment and make it waaaaay lighter by getting rid of jpg or png icons and just using pure svg on it. svg can be given a lot of attributes like movement, mouse hovering, change color, change anything. and most svg files are still under a megabyte. wow.. please let me know other fun facts about svg or eps files. i really like doing graphic design on linux and inkscape.

          A This user is from outside of this forum
          A This user is from outside of this forum
          [email protected]
          wrote on last edited by
          #52

          Hold on now. If an svg will render as valid html in browsers, does that mean I can use Inkscape as a wysiwyg webpage editor, and just export that to html?

          adrianhooves@lemmy.todayA 1 Reply Last reply
          0
          • A [email protected]

            Hold on now. If an svg will render as valid html in browsers, does that mean I can use Inkscape as a wysiwyg webpage editor, and just export that to html?

            adrianhooves@lemmy.todayA This user is from outside of this forum
            adrianhooves@lemmy.todayA This user is from outside of this forum
            [email protected]
            wrote on last edited by
            #53

            good question, i once made a website mockup on inkscape and it would be interesting if i could just turn that into an html file

            1 Reply Last reply
            0
            • M [email protected]

              So, my Lemmy app - and I think a lot of Lemmy, renders markdown, so whenever you write "<...>" It disappears for me!

              gomp@lemmy.mlG This user is from outside of this forum
              gomp@lemmy.mlG This user is from outside of this forum
              [email protected]
              wrote on last edited by
              #54

              I tried adding backslashes to escape, it still looks fine on lemmy.ml but your app may be bugged (and possibly vulnerable to xss? can you see the script block after the closed bracket?) <script>alert('you should not see an alert')</script>

              M 1 Reply Last reply
              0
              • gomp@lemmy.mlG [email protected]

                I tried adding backslashes to escape, it still looks fine on lemmy.ml but your app may be bugged (and possibly vulnerable to xss? can you see the script block after the closed bracket?) <script>alert('you should not see an alert')</script>

                M This user is from outside of this forum
                M This user is from outside of this forum
                [email protected]
                wrote on last edited by
                #55

                It all looks good now 🙂

                1 Reply Last reply
                0
                • A [email protected]

                  I fucking learned a whole-ass language for nothing back then because I thought it was the future!, fuck you, XHTML!

                  ? Offline
                  ? Offline
                  Guest
                  wrote on last edited by
                  #56

                  As someone who can find a billion XML parser libraries and, like, three HTML parser libraries, you do have my gratitude if it's worth anything.

                  1 Reply Last reply
                  0
                  • zarkanian@sh.itjust.worksZ [email protected]

                    I remember when XHTML was supposed to replace HTML. Everything was going to be standardized and web designers would run their HTML code against a validator...it was going to be glorious! And of course it never happened, because demanding that all websites conform to the XHTML standard would've broken a lot of websites.

                    So, HTML5 ate XHTML's lunch because it was much more forgiving, and...oh yeah, you could watch videos and play games in it, too.

                    ? Offline
                    ? Offline
                    Guest
                    wrote on last edited by
                    #57

                    Killing Flash was worth it, but couldn't we have avoided its reign of tyranny if we'd just stuck with Java applets in the first place...?

                    1 Reply Last reply
                    0
                    • G [email protected]

                      It annoys me that you aren't supposed to close input tags. At least browsers tolerate self closing them even if it is out of spec.

                      N This user is from outside of this forum
                      N This user is from outside of this forum
                      [email protected]
                      wrote on last edited by
                      #58

                      Technically it's not browser tolerance but spec tolerance. It's built into the html5 spec to tolerate different tags closing and other things invalid in xml.

                      This was an important design that grew out of one of the largest failings of xhtml that such failures would make the entire page unrenderable.

                      1 Reply Last reply
                      0
                      • System shared this topic on
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups