1. 首页
  2. 移动开发
  3. HTML5
  4. XHTML与HTML之间的区别

XHTML与HTML之间的区别

上传者: 2021-07-09 19:31:46上传 PDF文件 68.15 KB 热度 29次

翻译:Linyupark You can prepare yourself for XHTML by starting to write strict HTML.How To Get Ready For XHTMLIn 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.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 .Happy coding!The Most Important Differences:--------------------------------------------------------------------------------Elements Must Be Properly NestedThis text is bold and italicIn XHTML all elements must be properly nested within each other like this: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:Documents Must Be Well-formed--------------------------------------------------------------------------------Tag Names Must Be In Lower CaseThis is wrong:--------------------------------------------------------------------------------All XHTML Elements Must Be ClosedThis is wrong:This is a paragraphThis is a paragraph--------------------------------------------------------------------------------Empty Elements Must Also Be ClosedThis is wrong:This is a breakThis is a breakHere comes a horizontal rule:Here''''s an image

用户评论