×öÍøÕ¾    ÍøÒ³Éè¼Æ¡¢ÖÆ×÷    FLASHµ¼ÈëÒ³Éè¼Æ    ÍøÕ¾²ß»®¡¢¿ª·¢    ºǫ́³ÌÐòά»¤¡¢Éý¼¶    ÍøÕ¾½â¾ö·½°¸
¼¼ÊõÖ§³Ö£ºËÕç⠵绰£º15011022561XHTML±ê×¼Óï·¨
ÍøÒ³Éè¼Æ->HTML

XHTML±ê×¼Óï·¨

Some More XHTML Syntax Rules:
¸ü¶àXHTMLÓï·¨¹æÔò£º

  • Attribute names must be in lower case
    ÊôÐÔÃû³Æ±ØÐëΪСд
  • Attribute s must be quoted
    ÊôÐÔֵʹÓÃË«ÒýºÅ
  • Attribute minimization is forbidden
    ÊôÐÔ¼òдÊDz»ÔÊÐíµÄ
  • The id attribute replaces the name attribute
    ÓÃidÊôÐÔÀ´Ìæ´únameÊôÐÔ
  • The XHTML DTD defines mandatory elements
    XHTML DTD¶¨ÒåÇ¿ÖÆÔªËØ

Attribute Names Must Be In Lower Case
ÊôÐÔÃû³Æ±ØÐëΪСд

This is wrong:
ÕâÊÇ´íÎóµÄ£º

This is correct:
ÕâÊÇÕýÈ·µÄ£º


 


Attribute s Must Be Quoted
ÊôÐÔÖµ±ØÐë´øÉÏË«ÒýºÅ

This is wrong:
ÕâÊÇ´íÎóµÄ£º

This is correct:
ÕâÊÇÕýÈ·µÄ£º


 


Attribute Minimization Is Forbidden
²»ÔÊÐíÊôÐÔ¼òд

This is wrong:
ÕâÊÇ´íÎóµÄ£º




This is correct:
ÕýÈ·µÄÊÇÕâÑù£º




Here is a list of the minimized attributes in HTML and how they should be written in XHTML:
ÕâÊÇÔÚHTMLÖмòдµÄÊôÐÔºÍÆäÔÚXHTMLÖÐÓ¦¸ÃÔõÑùÊéдµÄÁÐ±í£º

HTMLXHTML 
compactcompact="compact"
checkedchecked="checked"
declaredeclare="declare"
readonlyreadonly="readonly"
disableddisabled="disabled"
selectedselected="selected"
deferdefer="defer"
ismapismap="ismap"
nohrefnohref="/nohref"
noshadenoshade="noshade"
nowrapnowrap="nowrap"
multiplemultiple="multiple"
noresizenoresize="noresize"

The id Attribute Replaces The name Attribute
idÊôÐÔÌæ»»nameÊôÐÔ

HTML 4.01 defines a name attribute for the elements a, applet, , i, img, and map. In XHTML the name attribute is deprecated. Use id instead.
¶ÔÓÚa, applet, , i, imgºÍmap£¬HTML 4.01Öж¨ÒåÁËÒ»¸önameÊôÐÔ£¬ÔÚXHTMLÖÐÊDz»ÔÞ³ÉÕâÑù×öµÄ£¬Ê¹ÓÃidÀ´´úÌæ¡£

This is wrong:
ÕâÊÇ´íÎóµÄ£º

This is correct:
ÕâÊÇÕýÈ·µÄ£º

Note: To interoperate with older browsers for a while, you should use both name and id, with identical attribute s, like this:
×¢Ò⣺ΪÁ˰汾±È½ÏµÍµÄä¯ÀÀÆ÷£¬ÄãÓ¦¸ÃͬʱʹÓÃnameºÍidÊôÐÔ£¬²¢Ê¹ËüÃÇÁ½¸öµÄÖµÏàͬµÄ£¬ÏñÕâÑù£º

IMPORTANT Compatibility Note:
¼æÈÝÐÔ×¢Òâµã£º

To make your XHTML compatible with today''s browsers, you should add an extra space before the "/" symbol.
ÈÃÄãµÄXHTML¼æÈݵ±Ç°µÄä¯ÀÀÆ÷ÄãÓ¦¸ÃÔÚ/±ê¼ÇǰÌí¼Ó¿Õ¸ñ

The Lang Attribute
Lang ÊôÐÔ

The lang attribute applies to almost every XHTML element. It specifies the language of the content within an element.
langÊôÐÔ¿ÉÒÔÓ¦ÓÃÓÚ¼¸ºõËùÓеÄXHTMLÔªËØ¡£ËüÖ¸¶¨ÁËÔªËØÖÐÄÚÈݵÄÓïÑÔ

If you use the lang attribute in an element, you must add the xml;lang attribute, like this:
Èç¹ûÄãÏñÔÚÒ»¸öÔªËØÖÐÓ¦ÓÃlangÊôÐÔ£¬Äã±ØÐë¼ÓÉÏxml:langÊôÐÔ£¬ÏñÕâÑù£º  

Heia Norge!


 

Mandatory XHTML Elements
Ç¿ÖÆXHTMLÔªËØ

All XHTML documents must have a DOCTYPE declaration. The html, head and body elements must be present, and the title must be present inside the head element.
ËùÓеÄXHTMLÎĵµ¶¼±ØÐëÓÐÒ»¸öDOCTYPEÉùÃû¡£html¡¢headºÍbodyÔªËØ±ØÐë³öÏÖ£¬²¢ÇÒtitle±ØÐëÔÚheadÔªËØÀï

This is a minimum XHTML document template:
ÕâÊÇÒ»¸ö¼«Ð¡µÄXHTMLÎĵµÄ£°å




Body text goes here

Note: The DOCTYPE declaration is not a part of the XHTML document itself. It is not an XHTML element, and it should not have a closing tag.
×¢Ò⣺DOCTYPEÉùÃ÷²¢²»ÊÇXHTMLÎĵµ×ÔÉíµÄÒ»²¿·Ö¡£ËüÒ²²»ÊÇXHTMLÔªËØ£¬Ëü²»¸ÃÓйرձêÇ©¡£

Note: The xmlns attribute inside the tag is required in XHTML. However, the validator on w3.org does not complain when this attribute is missing in an XHTML This is because "xmlns=http://www.w3.org/1999/xhtml" is a fixed and will be added to the tag even if you do not include it.
×¢Ò⣺XHTMLÎĵµÒªÇóxmlnsÊôÐÔ³öÏÖÔÚhtml±êÇ©ÖС£È»¶ø£¬w3.orgµÄУÑéÆ÷²»»áÓÉÓÚÕâ¸öÊôÐÔûÓгöÏÖÔÚÄãµÄXHTMLÎĵµÖжø±¨¸æ´íÎó¡£ÕâÊÇÒòΪ"xmlns=http://www.w3.org/1999/xhtml"ÊÇÒ»¸ö¹Ì¶¨µÄÖµ£¬¼´Ê¹ÄãµÄÎĵµÀïûÓаüº¬Ëü£¬ËüÒ²»á×Ô¶¯¼ÓÉϵġ£

·¢±íÆÀÂÛ

¹Ø±Õ´°¿Ú   À´Ô´:ÍøÂç  16  2007-05-14

±±¾©Ä§¿ìÍøÂç ½¨¸ßÆ·ÖʵÄÍøÕ¾£¡
©2002-  µç»°:15011022561(ËÕÏÈÉú)  Email:mokuainet@126.com
µØÖ·£º±±¾©¶«³ÇÇø¹¤Ì山·ÐÂÖÐÎ÷Àï17ºÅÂ¥±±±ßƽ·¿£¨±£Àû¾çÔº¶«100Ã×·±±£© ×öÍøÕ¾ÕÒħ¿ì£¬½¨Õ¾¿ì¡¢ÓÅ»¯ºÃ£¡MoKuai.Net
·