第 9 题:XHTML 和 HTML 有什么区别?

主要是体现在代码规范上,XHTML 规范会更加严格

XHTML 元素必须被正确地嵌套

  • 正确示范

    This text is bold and italic
  • 错误示范

    This text is bold and italic

XHTML 元素必须被关闭

  • 正确示范

    This is a paragraph

    This is another paragraph

    A break:
    A horizontal rule:
    An image: Happy face
  • 错误示范

    This is a paragraph

    This is another paragraph A break:
    A horizontal rule:


    An image: Happy face

标签名必须用小写字母

  • 正确示范

    
        

    This is a paragraph

  • 错误示范

    
        

    This is a paragraph

XHTML 文档必须拥有根元素

  • 所有的 XHTML 元素必须被嵌套于 根元素中

    
     ... 
     ... 
    

附加

你可能感兴趣的:(html)