当前位置:甜馍馍地理信息网 >> 网站开发 >> 综合知识 >> 正文 >>  [阅读资讯:HTML文档规范化简洁化 HTML TIDY介绍及使用]

HTML文档规范化简洁化 HTML TIDY介绍及使用

[ 来源:W3C | 时间:2008年03月17日 | 收藏本文 ] 【
Tutorials for HTML and CSS

If you are just starting off and would like to know more about how to author Web pages, you may find my guide to HTML and CSS helpful. Please send me feedback on this, and I will do my best to further improve it.

HTML Slidy - a Web based alternative to PowerPoint

A new relative to Tidy, HTML Slidy is my open source presentation tool for slides written in XHTML. It provides an accessible alternative to traditional presentation tools like Microsoft PowerPoint. Best of all, there is no software to install, it just works from the Web!

Examples of TIDY at work

Tidy corrects the markup in a way that matches where possible the observed rendering in popular browsers from Netscape and Microsoft. Here are just a few examples of how TIDY perfects your HTML for you:

  • Missing or mismatched end tags are detected and corrected
       <h1>heading
       <h2>subheading</h3>
    

    is mapped to

       <h1>heading</h1>
       <h2>subheading</h2>
    
  • End tags in the wrong order are corrected:
       <p>here is a para <b>bold <i>bold italic</b> bold?</i> normal?
    

    is mapped to

       <p>here is a para <b>bold <i>bold italic</i> bold?</b> normal?
    
  • Fixes problems with heading emphasis
       <h1><i>italic heading</h1>
       <p>new paragraph
    

    In Netscape and Internet Explorer this causes everything following the heading to be in the heading font size, not the desired effect at all!

    Tidy maps the example to

       <h1><i>italic heading</i></h1>
       <p>new paragraph
    
  • Recovers from mixed up tags
       <i><h1>heading</h1></i>
       <p>new paragraph <b>bold text
       <p>some more bold text
    

    Tidy maps this to

       <h1><i>heading</i></h1>
       <p>new paragraph <b>bold text</b>
       <p><b>some more bold text</b>
    
  • Getting the <hr> in the right place:
       <h1><hr>heading</h1>
       <h2>sub<hr>heading</h2>
    

    Tidy maps this to

       <hr>
       <h1>heading</h1>
       <h2>sub</h2>
       <hr>
       <h2>heading</h2>
    
  • Adding the missing "/" in end tags for anchors:
       <a href="#refs">References<a>
    

    Tidy maps this to

       <a href="#refs">References</a>
    
  • Perfecting lists by putting in tags missed out:
       <body>
       <li>1st list item
       <li>2nd list item
    

    is mapped to

       <body>
       <ul>
       <li>1st list item</li>
       <li>2nd list item</li>
       </ul>
    
  • Missing quotes around attribute values are added

    Tidy inserts quote marks around all attribute values for you. It can also detect when you have forgotten the closing quote mark, although this is something you will have to fix yourself.

  • Unknown/Proprietary attributes are reported

    Tidy has a comprehensive knowledge of the attributes defined in the HTML 4.0 recommendation from W3C. This often allows you to spot where you have mistyped an attribute or value.

  • Proprietary elements are recognized and reported as such.

    Tidy will even work out which version of HTML you are using and insert the appropriate DOCTYPE element, as per the W3C recommendations.

  • Tags lacking a terminating '>' are spotted

    This is something you then have to fix yourself as Tidy is unsure of where the > should be inserted.

上一页      下一页
本文共 6 页,第  [1]  [2]  [3]  [4]  [5]  [6]  页

【推荐本文】 【打印本页】 【返回顶部
最新文章
推荐文章