<!DOCTYPE xxx>
<html>
<head>
<meta>
<title>标题部分</title>
</head>
<body>
内容
</body>
</html>
二、各网页结构标签说明
1、<!DOCTYPE xxx>
作用:声明文档类型,如果没有文档类型声明,大多数浏览器将转换成混杂模式。
HTML5:<!DOCTYPE html>即可
2、<html>
lang属性:语言声明。
例如:<html lang="en">,<html lang="zh-CN">
3、<link>
作用:定义文档与外部资料的关系
功能——添加rss订阅:通过设置类型为rss+xml的link元素,
<link rel=”alternate” type=”application/rss+xml” title=”My Blog” href=”rss.xml”>
4、<base>
作用1:定义文档基本URL地址。例如:
页面中存在<a href="a.html">,<base href="www.liuhuan.com/html5/">,实际<a href="www.liuhuan.com/html5/a.html">
作用2:定义全局浏览器打开方式。
例如:设置新窗口打开
<base target="_blank">
5、<mate>
!必须设置以下属性其中一种
name(元数据名称)/http-equiv(编译指令)/charset(字符编码)
作用1:设置编码方法(必须)
例如:<mate charset=”utf-8”>
作用2:通过添加renderer指定浏览器的渲染内核
webkit(极速核)/ie-comp(IE兼容内核)/ie-stand(IE标准内核)
例如:<mate name=”renderer” content=”webkit”>
作用3:搜索引擎优化
例如:
<mate name=”keyWords” content=”HTML5,前端”>
<mate name=”description” content=”这是HTML基础”>
作用4:控制搜索引抓取
例如:
不让搜索引抓取
<mate name=”robots” content=”none”>
让搜索引检索及查询全部
<mate name=”robots” content=”all”>
作用5:移动端设置
例如:
设置数字不自动设别为手机号码
<mate name=”format-detection” content=”telephone=no”>
优化老手机设备
<mate name=”HandheldFriendly” content=”true”>
作用6:移动端Viewport(视口)设置
例如:
initial-scale=1.0初始大小;
user-scalable=no用户不可缩放;
maximun-scale=1.0最大缩放值
<mate name=”viewport” content=”width=devide-width,initial-scale=1.0 user-scalable=no,maximun-scale=1.0”>
新闻热点
疑难解答