1. Introduction t0 HTML-Introduc
2020-05-20 本文已影响0人
晨曦Bai
资料来源:https://developer.mozilla.org/en-US/docs/Web/Tutorials

1. What is HTML ?
(Hypertext Markup Language)
- It is a
markup Language
, used to tell your browser how to structure the web pages you visit.- HTML consists of a series of
elements
, which enclose, wrap, or mark up different parts of the content to make it appear or act a certain way.- Tags in HTML are case-insensitive.
i.e. uppercase or lowercase
Write all tags in lowercase for consistency, readability, and other reasons.
- Nesting elements
- Block versus inline elements
- Empty elements
- Attributes
- HTML 是
标记语言
,用于表示浏览器如何组建web 网页的。
- HTML 由一系列
元素(element)
构成。
标签元素结构:
image.png
- HTLM 标签
不区分大小写
, 一般为了方便阅读,都用小写
- 元素可以嵌套
- 元素分为块元素和行内元素
- 块元素
以新行显示, 结构化元素。
e.g.
块元素不能嵌入到行元素,可以嵌入到其他块元素- 行内元素
不会另起一行, 被包含在块元素内。
e.g.a
,img
,em
,strong
- 空标签
只有单个标签。
e.g.<img/>
,<base/>
,<meta/>
,<link/>
,<input/>
,<hr/>
,<br/>
- 标签属性
包含标签额外信息,该信息不会在网页内容中显示。
包含属性的标签结构:
image.png
- 属性名称和标签名称之间必须有一个
空格
- 属性名称后接等号
=
- 等号后接
属性值
,属性值用双引号 or 单引号
括起来
- 布尔型属性
只有一个属性值, 一般属性值和属性名称一样
e.g.<input type="text" disabled>
HTML 文件结构
image.png
- HTML 代码中 无论有多少空格,都会解析成
1个空格
- 想在网页上显示特殊符号,必须使用
character reference (符号引用)
,&
开始 ,;
结束
image.png
apostrophe /əˈpɒstrəfi/
ampersand /ˈæmpəsænd/
quotes