Home >Web Front-end >HTML Tutorial >2. Html basic syntax_html/css_WEB-ITnose

2. Html basic syntax_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:45:161228browse

  • 1. Basic structure and rules of XHTML
  • <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head></head><body></body></html>

    Note:

    1. We must develop good habits. When we write empty tags in the future, we must add a space before the slash (/), such as

    2, all attribute names of all elements should be lowercase, all attributes must specify attribute values, no abbreviations, and all attribute values ​​must be enclosed in quotes.


  • 2. XHTML uses DTD to specify semantic constraints
  • DTD information should be added at the beginning of the XHTML document. It is a must for the XHTML document. part, so we write a standard html document that should have a DTD. For example:


    There are three XHTML document types:
    STRICT (strict type): Clean markup is required to avoid clutter in performance. Generally used in conjunction with CSS.
    TRANSITIONAL: When you need to take advantage of the presentational features of HTML and when you need to write XHTML for browsers that do not support cascading style sheets.
    FRAMESET (frame type): When you need to use HTML frames to split the browser window into two or more frames.
    1, XHTML 1.0 Strict:
    <!DOCTYPE htmlPUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    2, XHTML 1.0 Transitional:
    <!DOCTYPE htmlPUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    3, >
    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