主要包含了页面是元数据css
<head>
<meta charset="utf-8">
<title>My test page</title>
</head>
复制代码
h1 会加载显示在页面中html
title 是用来表示整个html文档大体内容的元数据浏览器
<meta>
在 head 中能够出现任意多个 meta 标签。通常的 meta 标签由 name 和 content 两个属 性来定义。name 表示元信息的名,content 则用于表示元信息的值。安全
元数据就是描述数据的数据,而HTML有一个“官方的”方式来为一个文档添加元数据—— 元素。app
<meta charset="utf-8">
<meta name="author" content="Chris Mills">
<meta name="description" content="The Mozilla Developer Network (MDN) provides information about Open Web technologies including HTML, CSS, and APIs for both Web sites and HTML5 Apps. It also documents Mozilla products, like Firefox OS.">
复制代码
一个典型的针对移动端优化的站点包含相似下面的内容:编辑器
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
复制代码
viewport主要有如下属性ide
属性 | 说明 |
---|---|
width | 页面具体宽度,能够取具体数值 |
height | 页面高度,能够取值具体的数字 |
initial-scale | 初始缩放比例。 |
minimum-scale | 最小缩放比例 |
maximum-scale | 最大缩放比例 |
user-scalable | 是否容许用户缩放 |
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="my-css-file.css">
工具
<script src="my-js-file.js"></script>
优化