XHTML과 HTML_CSS/HTML의 차이점

WBOY
풀어 주다: 2016-05-16 12:11:23
원래의
1437명이 탐색했습니다.

翻译:Linyupark

You can prepare yourself for XHTML by starting to write strict HTML.
你可以开始通过书写严格的HTML代码来为你的XHML之行做好准备


--------------------------------------------------------------------------------

How To Get Ready For XHTML
如何为XHTML做准备呢?
XHTML is the next generation of HTML, but it will of course take some time before browsers and other software products are ready for it.
XHTML是HTML的下一代语言,但它将理所当然的在新的浏览器和其他的相关软件产品出现之前延迟一段时间才能普及。

In the meantime there are some important things you can do to prepare yourself for it. As you will learn from this tutorial, XHTML is not very different from HTML 4.01, so bringing your code up to 4.01 standards is a very good start. Our complete HTML 4.01 reference can help you with that.
其间,去做一些重要的事情来为它做准备。就像你可以从这教程学到东西一样,XHTML与HTML4.01相差不多,所以把你的代码改写成符合HTML4.01标准是一种非常好的开始,我们完整的HTML4.01参考可以帮助你解决这个问题。

In addition, you should start NOW to write your HTML code in lowercase letters, and NEVER make the bad habit of skipping end tags like the

.
另外,现在你应该开始用小写字母来书写你的HTML代码,并且永远不要再像以前那样有跳过像

这样的结尾标签的坏习惯。

Happy coding!
快乐的编码!


--------------------------------------------------------------------------------

The Most Important Differences:
非常重要的区别:
XHTML elements must be properly nested
XHTML元素必须合理嵌套
XHTML documents must be well-formed
XHTML文档必须格式正确
Tag names must be in lowercase
标签名称必须是小写
All XHTML elements must be closed
所有XHTML元素必须关闭

--------------------------------------------------------------------------------

Elements Must Be Properly Nested
元素必须合理嵌套
In HTML some elements can be improperly nested within each other like this:
在HTML中一些元素可以不使用正确的相互嵌套像这样:

This text is bold and italicIn XHTML all elements must be properly nested within each other like this:
在XHTML所有元素必须合理的相互嵌套像这样:

This text is bold and italicNote: A common mistake in nested lists, is to forget that the inside list must be within a li element, like this:
注意:在列表嵌套的时候经常会犯一个错误,就是忘记了在列表中插入的新列表必须在一个

  • 标记中,像这样:


       
    • Coffee

    •  
    • Tea
         

             
      • Black tea

      •      
      • Green tea

      •    

       
    • Milk

    This is correct:
    这才是正确的:


       
    • Coffee

    •  
    • Tea
         

             
      • Black tea

      •      
      • Green tea

      •    

       

    •  
    • Milk

    Notice that we have inserted a
  • tag after the tag in the "correct" code example.
    在这段正确的代码示例中,要注意在之后加了一个标签


    --------------------------------------------------------------------------------

    Documents Must Be Well-formed
    文档格式必须合格
    All XHTML elements must be nested within the root element. All other elements can have sub (children) elements. Sub elements must be in pairs and correctly nested within their parent element. The basic document structure is:
    所有的XHTML标记必须被嵌套使用在 根标签之中。所有其他的标签可以有自己的子标签。位于父标签之内的子标签也必须成对且正确的嵌套使用。一个网页的基本结构是:


    ...
    ...

    ------------------------------------------------ --- -----------------------------------

    Nama Teg Mesti Dalam Huruf Kecil
    Nama Teg Mesti Dalam Huruf Kecil
    Ini kerana dokumen XHTML adalah aplikasi XML yang sensitif terhadap huruf besar dan kecil seperti
    ditafsirkan sebagai teg yang berbeza.
    Ini kerana dokumen XHTML ialah aplikasi XML dan XML adalah sensitif huruf besar-besaran, seperti
    dan

    Ini salah:
    Ini salah:


    Ini ialah perenggan


    Ini betul:
    Ini betul:


    Ini ialah perenggan


    ------------------------------------------------ --- -----------------------------------

    Semua Elemen XHTML Mesti Ditutup
    Semua elemen XHTML mesti ditutup
    Elemen bukan kosong mesti mempunyai teg tamat.
    Elemen bukan kosong mesti mempunyai teg akhir.

    Ini salah:
    Ini salah:

    Ini perenggan

    Ini perenggan lainIni betul:
    Betul ini:

    Ini ialah perenggan


    Ini perenggan lain

    ------------------------------------------------ --- -----------------------------------

    Elemen Kosong Mesti Juga Ditutup
    Elemen kosong mesti sama ada mempunyai teg tamat atau teg mula mesti diakhiri dengan />.
    Elemen kosong juga mesti mempunyai teg Tamat atau teg pembuka berakhir dengan /> .

    Ini salah:

    Ini salah:

    Ini adalah rehat

    Inilah peraturan mendatar:



    Inilah imej Wajah gembiraIni betul:
    Ini betul:

    Ini adalah rehat

    Inilah peraturan mendatar:
    Ini'''''s a image Happy.gif

    PENTING Nota Keserasian:
    Perhatikan kunci keserasian:
    Untuk menjadikan XHTML anda serasi dengan penyemak imbas hari ini, anda harus menambah ruang tambahan sebelum simbol "/" seperti ini:
    , dan ini:


    .
    Untuk menjadikan XHTML anda serasi dengan pelayar moden, anda mesti menambah ruang khas sebelum simbol /, seperti ini:
    dan seperti ini:


    원천:php.cn
    본 웹사이트의 성명
    본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
    인기 튜토리얼
    더>
    최신 다운로드
    더>
    웹 효과
    웹사이트 소스 코드
    웹사이트 자료
    프론트엔드 템플릿
    회사 소개 부인 성명 Sitemap
    PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!