Home  >  Article  >  Web Front-end  >  Some differences and notes between html, xhtml and html5_html/css_WEB-ITnose

Some differences and notes between html, xhtml and html5_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:44:481177browse

XHTML,HTML

 01, the tag specifications are more strict. W3C has always respected XHTML, a strict type of syntax, but after XHTML was upgraded from 1.0 to 1.1 Died in infancy. The main difference between html and xhtml:

XHTML elements must be nested correctly.

Incorrect:
  • Correct:
  • The XHTML element must be closed.
  • Error:

    xxxx

  • Correct:

    xxxx

  • Tag names must be in lowercase letters.
  • Error:
  • Correct:
  • XHTML document must have root element.
  • Others
  • It is not allowed to use target="_blank" Starting from XHTML 1.1, the target attribute is completely prohibited. If you want to have the function of opening a new window, just It must be rewritten as rel="external" and used with JavaScript to achieve this effect.

    Error: MUKI space

    Correct: MUKI space


    How to verify whether your HTML or XHTML is legal?
     
    1:

    Copy the code directly to w3.org for online testing: http://validator.w3.org/check;

    2:

    You can also directly change the html to xhtml ending, and then open it with the firefox browser; 🎜>HTML4

    is more relaxed, no longer based on SGML, and adds a lot of

    semantic HTML

    tags, as well as audio, video, document declaration has become simpler, and string encoding has been added meta, delete some html tags (font, frameset) from the 1990s, etc....

    Broadly speaking,

    HTML5

    has brought us The higher version of CSS, that is, CSS2.0 has been upgraded to CSS3.0, and Javascript also provides more API support (canvas, postMessage, notify, worker), making the WEB more beautiful; 《HTML 4.01 Reference Manual》 《HTML5》

    Statement:
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn