Detailed introduction to the basic format of HTML documents

黄舟
Release: 2017-04-24 10:12:43
Original
3174 people have browsed it

1. Basic format of HTML document:

<!DOCTYPE html>  //文档类型声明
<html lang=&#39;zh-cn&#39;>                  //表示HTML文档开始
<head>              //包含文档元数据开始
<meta charset=&#39;utf8&#39;>           //声明字符编码
<title>基本</title>     //设置文档标题
</head>     //包含文档元数据结束
<body>     //表示HTML文档内容
</body>     //表示HTML
<a href="http://wwww.baidu.com">百度</a>
</html>      //表示HTML文档结束
Copy after login

2. Document structure analysis:

1. Doctype

Document Type Declaration, also Called Doctype), it mainly tells the browser the type of document being viewed.

<!DOCTYPE html>  不区分大小写
Copy after login

2. HTML element

First of all, element means tag, and html element is html tag. The html element is the element at the beginning of the document and at the end of the document. It is a double tag that echoes the beginning and the end. The html element has an attribute and value

lang='zh-cn', which means that the document language is Simplified Chinese

<html>   如果为英文则,lang="en"
Copy after login

3. Head element

is used to contain metadata content. Metadata includes: , , ,

Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!