XHTML标准语法
The id Attribute Replaces The name Attribute This is wrong: <img src="http://www.jb51.net/article/picture.gif" />This is correct: <img src="http://www.jb51.net/article/picture.gif" />Note: To interoperate with older browsers for a while, you should use both name and id, with identical attribute values, like this: <img src="http://www.jb51.net/article/picture.gif" />IMPORTANT Compatibility Note: To make your XHTML compatible with today''''s browsers, you should add an extra space before the "http://www.jb51.net/" symbol.
The Lang Attribute If you use the lang attribute in an element, you must add the xml:lang attribute, like this: <div lang="no" xml:lang="no">Heia Norge!</div> -------------------------------------------------------------------------------- Mandatory XHTML Elements This is a minimum XHTML document template: <!DOCTYPE Doctype goes here> Note: The xmlns attribute inside the <html> tag is required in XHTML. However, the validator on w3.org does not complain when this attribute is missing in an XHTML document. This is because "xmlns=http://www.w3.org/1999/xhtml" is a fixed value and will be added to the <html> tag even if you do not include it. (编辑:焦作站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |