HTML Basics Tut...LOGIN

HTML Basics Tutorial: Introduction to XHTML

Introduction to .

XHTML is a new generation of HTML markup language.

  • The purpose of XHTML is to replace HTML.

  • XHTML tags are exactly the same as HTML.

  • The syntax of XHTML is much stricter than HTML.

  • XHTML Extensible Hypertext Markup Language.

  • XHTML writing specifications

All tags and attributes must be all lowercase

  • One-sided tags must be turned off. For example: <br> ——> <br />

  • All attribute values ​​must be enclosed in quotation marks.

  • All attributes must have values. For example: <hr noshade> —— <hr noshade = “noshade” />

  • Tags must be nested sequentially, with the outer layer nested within the inner layer, and one layer within another. layer.

  • XHTML web pages must have DTD document type definition code.

  • Note: I hope that when you write HTML in the future, you will try to strictly follow the XHTML writing specifications

##DTD document type definition

#The purpose of DTD document type definition: it is a verification mechanism, that is, to check whether the XHTML markup syntax you wrote is legitimate.

There are three major types of DTD:

(1) Strict DTD

In strict type In the DTD, various presentation tags can no longer be used. For example: <font>, <b>, <body bgColor>

requires that CSS must be used to replace various performance tags.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >

(2) Transitional DTD

In the transitional DTD, you can continue to use the expression writing method in HTML.

These performance markers can still be used. Such as: <font>, <b>, <body bgColor>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www .w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

(3)Framework DTD

<!DOCTYPE html PUBLIC " -//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

Next Section
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>这是我们的第一个页面</title> </head> <body> <h1>欢迎加入php.cn</h1> <h2>希望你能够在这里学的开心</h2> </body> </html>
submitReset Code
ChapterCourseware