Documents

What is the semantic difference between the following:

  • <html xmlns='http://www.w3.org/1999/xhtml'>
    <head>
      <title></title>
    </head>
    <body>
      <p>This is a paragraph.</p>
      <object>
        <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2 2'>
          <circle cx='1' cy='1' r='1' fill='lime'/>
        </svg>
      </object>
    </body>
    </html>
  • <html xmlns='http://www.w3.org/1999/xhtml'>
    <head>
      <title></title>
    </head>
    <body>
      <p>This is a paragraph.</p>
      <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2 2'>
        <circle cx='1' cy='1' r='1' fill='lime'/>
      </svg>
    </body>
    </html>
  • <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2 2'>
      <foreignObject>
        <p xmlns='http://www.w3.org/1999/xhtml'>This is a paragraph.</p>
      </foreignObject>
      <circle cx='1' cy='1' r='1' fill='lime'/>
    </svg>
  • <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2 2'>
        <p xmlns='http://www.w3.org/1999/xhtml'>This is a paragraph.</p>
      <circle cx='1' cy='1' r='1' fill='lime'/>
    </svg>

(Feel free to correct my SVG, but that’s not what the question is about.)

Leave a Reply