以下是 xHTML 列表:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"[]>
<html xmlns:html="http://www.w3.org/1999/xhtml">
<html:head>
<html:meta http-equiv="Content-Type" content="text/html" charset="utf-8" />
<html:title>
Page Title</html:title>
<html:meta name="keywords" content="Stuff the page is about" />
<html:meta name="description" content="Great little webpage" />
<html:script type="text/javascript" />
</html:head>
<html:body>
<html:table height="800px" width="100%">
<html:tr style="height:798px;">
<html:td />
<html:td height="100%" width="1100px">
<html:iframe height="100%" src="CapabilitiesList.htm" width="100%" frameborder="0" scrolling="no" />
</html:td>
<html:td />
</html:tr>
</html:table>
</html:body>
</html>
答案1
您不必为基本 XHTML 文件定义命名空间。事实上,在典型的网页文件中,命名空间被假定为 XHTML。
错误的部分是在每个元素名称前都加上html:
。
此外,还有几个错误。表格不能有高度和宽度属性,而元属性字符集是多余的。找出五点不同之处:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content=
"HTML Tidy for Linux/x86 (vers 25 March 2009), see www.w3.org" />
<meta http-equiv="Content-Type" content="text/html" />
<title>Page Title</title>
<meta name="keywords" content="Stuff the page is about" />
<meta name="description" content="Great little webpage" />
<script type="text/javascript">
</script>
</head>
<body>
<table>
<tr style="height:798px;">
<td></td>
<td><iframe height="100%" src="CapabilitiesList.htm" width=
"100%" frameborder="0" scrolling="no"></iframe></td>
<td></td>
</tr>
</table>
</body>
</html>