DTD文档模型和HTML基础

时间:2024-07-25 14:34:14

html是超文本标记语言,现在常用到的2中文档格式是html5和XHTML 1.0 Transitiona(过渡)。

<!DOCTYPE html>
<!--当前文档为html5-->
<html>
<head>
<meta charset="utf-8"/>
<!--格式编码utf-8 中文gb-2312-->
</head>
<body>
</body>
</html>
<!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 http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
</body>
</html>
<head>
<!--设置文档编码-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta charset="utf-8" />
<!--设置关键字和描述方便SEO-->
<meta name="keywords" content="关键字">
<meta name="description" content="网站描述">
<!--设置移动端开发缩放比例-->
<meta name="viewport"
content="width=device-width,
initial-scale=1.0,
maximum-scale=1.0,
user-scalable=0;">
</head>