Front end (html_01) 01-html tag head and introduced

01-html and head tags Introduction

 

main content

  • web standards

  • Browser Introduction

  • Introduction Development Tools

  • HTML Introduction

  • HTML color presentation

  • HTML specification

  • Detailed HTML structure

A, web standards

web ready to introduce:

  • w3c: World Wide Web Consortium organization, used to develop web standards bodies (organizations)
  • web standards: web pages follow norms
  • web prepared formal classification: structural standards, performance standards, standards of conduct.
  • Structure: html. He represents: css. Behavior: Javascript.

web Preparation summary:

  • Standard Structure: equivalent to the human skeleton. html is used to create web pages.
  • Performance Standards: the equivalent of their clothing. css is the beautification of the web pages.
  • Standards of conduct: the equivalent of human action. JS is to make web pages move, with vitality

 If you do not understand, see below

Second, the introduction browser

Is a web browser running platform, commonly used browsers IE, Firefox (Firefox), Google (Chrome), cheetah browser, Safari and Opera

Browser kernel :

Browser  Kernel
IE trident
chrome blink
Firefox gecko
Safari webkit

 

PS: "browser kernel" that is used by the browser "rendering engine", the browser rendering engine determines the format of the information content of the page and how to display the page.

Summary: The rendering engine is the root cause compatibility problems.

Third, development tools

  • The use Sublime Text  Sublime Text Tips
  • Visual Studio Code Editor
  • WebStorm
  • PyCharm
  • .....

 

Four, HTML presentation

1, HTML overview

html stands for HyperText Mackeup Language, translated into HTML, it is not a programming language, is a descriptive markup language for describing display hypertext content. Such as font, color, size and so on.

  • Hypertext: audio, video, pictures, called hypertext.
  • Tag: <English words or letters> called tag, an HTML page is composed from a variety of markers.

Role : HTML document is responsible for describing the semantics of the language.

Note : HTML is not a programming language language (there are compilation process), but a markup language ( no compilation ), HTML pages directly from the browser parse executed.

HTML is responsible for describing the semantics of the language of the document, in html, in addition to semantics , nothing else.

This article is a pure html file (txt file is to use the renamed made), with some tags to describe the semantics of the text, these tags in the browser which is not visible, so called "hypertext", so is the "hypertext Markup language "was.

So, the next, we will certainly have to learn a bunch of html tags for children in these tags can give children a different text semantics.

2, HTML web term

  • Pages: a page composed of various marks called pages.
  • Home (Home): a website start page or navigation page.
  • Tags:  <p>called the start tag, </p>called an end tag, also called tags. Each tag ordained a special meaning.
  • Element: <p>内容</p>called elements.
  • Properties: to each label made auxiliary information.

 

Five, HTML color presentation

1. color representation

  • Pure word representation: red, green, blue, orange, gray, etc.
  • 10 hexadecimal: rgb (255,0,0)
  • Hexadecimal: # FF0000, # 0000FF, # 00FF00 etc.

2.RGB color mode

  • Nature of all the colors can be red, green, blue (RGB) intensity of the three different colors obtained by a combination of wavelengths, which is commonly known as the principle of the three primary colors.
  • RGB RGB is also called additive color model, because when we put different wavelengths of light are added together, they can get a different mixed colors. Example: Yellow = Red + Green, Red + Blue = violet, green and blue = green +
  • In digital video, the three primary colors of RGB each 8-bit encoding constitutes approximately 16.78 million kinds of color, this is what we often say that the true color. All display devices are used in a RGB color mode.
  • Each RGB 256 (0-255) brightness, RGB color 256 of total composition of about 16.78 million kinds of colors, i.e., 256 × 256 × 256 = 16777216.

 

 

 

Six, HTML specification

  • HTML is a weak language
  • HTML is not case sensitive
  • Extension of the HTML page is html or htm (some systems do not support extension longer than three characters, such as dos system)
  • HTML structure:
    • Declarations section: The main role is to tell the browser to use this page Which standards. HTML5 is standard.
    • head part: some extra information page tells the server. It will not be displayed on the page.
    • body parts: we have written code must be placed within this tag.

1, specification writing HTML

1) All the elements must be properly nested tag, you can not cross nested. Correct wording Example:<h1><font></font></h1>

(2) All tags must be lowercase.

(3) All tags must be closed.

  • Bilateral mark:<span></span>
  • Unilateral mark: <br> turn to  <br /> <hr> turn to  <hr />, as well as<img src=“URL” />

(4) all attribute values ​​must be quoted. <H1 id = "head"> </ h1>

(5) All property must have a value.<input type="radio" checked="checked" />

2, the basic grammatical features of HTML

  • HTML is not sensitive to wrap insensitive to tab

  Only care about HTML tags nested structure of nested relations. Who nested whom, who nested whom, and line breaks, tab unrelated. For no change line, tab not tab, does not affect the structure of the page.

  In other words, HTML is not relying indentation to represent nested, it is to see the relationship between the package label. However, we have found a good indentation, code more readable. He asked us to correctly indent tag.

  • Blank folding phenomenon

  All HTML between text , if there are spaces, line breaks, tab will be folded into a blank display.

  • The label should be strictly closed
<html></html>
<meta />

 

Seven, HTML structure Detailed

New HTML file, input html: 5, press the tab key, the auto-generated code is as follows:

Copy the code
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
Copy the code

1, the first document declaration

Any standard HTML page, the first line is a must in order to

<!DOCTYPE...

The beginning of the line, is the first document declaration, DocType Declaration, referred to as the DTD. This tag tells the browser which HTML or XHTML specification documentation use.

 

 

XHTML: Extensible Hypertext Markup Language, Extensible Hypertext Markup Language.

The main purpose of XHTML is to replace HTML , it can be understood as an upgraded version of HTML.

HTML tags writing is not standardized, it will cause other devices (ipad, phone, TV, etc.) can not be displayed properly.

XHTML markup HTML4.0 with substantially the same.

XHTML is strict, pure HTML

 

Learn to do the following only:

HTML4.01 What spec?

First we determine one thing, we now learn is HTML4.0.1 this version, this version is compatible with IE6 start. HTML5 is beginning to open IE9 compatible . But IE6,7,8 these browsers can not prematurely eliminated, so the past few years the web or use HTML4.01 should be made. Today, Web phones, mobile terminals, you can use HTML5, because of its higher compatibility.

Say a digression, html1 to html3 the US military as well as with the Institute of Advanced Studies, did not open to the public.

HTML4.01 There are two kinds of norms, norms which every species of large and small have three kinds of specifications. Therefore, a total of six kinds of specifications (see below):

HTML4.01 which provides general and XHTML are two kinds of specifications.

HTML feel that they have some of the provisions are not strict, for example, whether the label can be used in capital letters it?<H1></H1>

So, HTML feel, some norms stringent standards, but also developed a XHTML1.0. In XHTML letter X, said that "strict."

To summarize, HTML4.01 a total of six kinds of DTD, it plainly, HTML first statement, a total of six kinds:

Next, three kinds of small image above specification will be explained:

  • strict : that "strict", this model which more stringent requirements. This rigorous reflected in where? Some tags can not be used.
    For example, u label, it is to give a paper underlined, but that's the nature of HTML and there is a conflict, because only responsible for semantic HTML is not responsible for style, and u is the underline style. So strict is not in use u label.
    Then how to increase the text underline it? Future css css property will be used to solve.
    So, XHTML1.0 more stringent, because the system itself provides for such labels must be lowercase letters, labels must be strictly closed, you must use quotation marks property and so on.

  • Transitional : that "ordinary", this model is not some other specifications.

  • Frameset : represents the "framework" is used in the page frame.

Html sublime in input: xt, x represents XHTML, t represents a transitional.
In HTML5 greatly simplifies the DTD, that is to say there is no HTML5 in the XHTML (W3C himself playing the face):

<!DOCTYPE html>

 ok, the following priorities here.

 

 

2, the first label (head)

head tag are placed between the head portion. It <title>、<meta>contains: ,<link>,<style>

  • <title>: Specifies the whole page title is displayed at the top of the browser.
  • <meta>: Provides basic information about the page
  • <link>:定义文档与外部资源的关系。
  • <style>:定义内部样式表与网页的关系

 

Meta标签

元素可提供有关页面的原信息(mata-information),针对搜索引擎和更新频度的描述和关键词。

标签位于文档的头部,不包含任何内容。

提供的信息是用户不可见的。 meta标签的组成:meta标签共有两个属性,它们分别是http-equiv属性和name属性,不同的属性又有不同的参数值,这些不同的参数值就实现了不同的网页功能。

常用的meta标签:

  • http-equiv属性

它用来向浏览器传达一些有用的信息,帮助浏览器正确地显示网页内容,与之对应的属性值为content,content中的内容其实就是各个参数的变量值。

 

Copy the code
<!--重定向 2秒后跳转到对应的网址,注意分号-->
<meta http-equiv="refresh" content="2;URL=http://www.luffycity.com">
<!--指定文档的内容类型和编码类型 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<!--告诉IE浏览器以最高级模式渲染当前网页-->
<meta http-equiv="x-ua-compatible" content="IE=edge">
Copy the code
  • name属性

主要用于页面的关键字和描述,是写给搜索引擎看的,关键字可以有多个用 ‘,’号隔开,与之对应的属性值为content,content中的内容主要是便于搜索引擎机器人查找信息和分类信息用的。

<meta name="Keywords" content="网易,邮箱,游戏,新闻,体育,娱乐,女性,亚运,论坛,短信" />

这些关键词,就是告诉搜索引擎,这个网页是干嘛的,能够提高搜索命中率。让别人能够找到你,搜索到。

<meta name="Description" content="网易是中国领先的互联网技术公司,为用户提供免费邮箱、游戏、搜索引擎服务,开设新闻、娱乐、体育等30多个内容频道,及博客、视频、论坛等互动交流,网聚人的力量。" />

 只要设置Description页面描述,那么百度搜索结果,就能够显示这些语句,这个技术叫做SEO(search engine optimization,搜索引擎优化)。

效果如下:

 

 

<meta name=viewport content="width=device-width, initial-scale=1">

上面这个标签,是让我们网页支持移动端,移动设备优先(了解即可)

 

title标签

主要用来告诉用户和搜索引擎这个网页的主要内容是什么,搜索引擎可以通过网页标题,迅速的判断出当前网页的主题。 

 <title>路飞学城</title>

主要内容

  • web标准

  • 浏览器介绍

  • 开发工具介绍

  • HTML介绍

  • HTML颜色介绍

  • HTML规范

  • HTML结构详解

一、web标准

web准备介绍:

  • w3c:万维网联盟组织,用来制定web标准的机构(组织)
  • web标准:制作网页遵循的规范
  • web准备规范的分类:结构标准、表现标准、行为标准。
  • 结构:html。表示:css。行为:Javascript。

web准备总结:

  • 结构标准:相当于人的骨架。html就是用来制作网页的。
  • 表现标准: 相当于人的衣服。css就是对网页进行美化的。
  • 行为标准: 相当于人的动作。JS就是让网页动起来,具有生命力的

 如果大家还不明白,请看下图

二、浏览器介绍

浏览器是网页运行的平台,常用的浏览器有IE、火狐(Firefox)、谷歌(Chrome)、猎豹浏览器、Safari和Opera等

浏览器内核

浏览器  内核
IE trident
chrome blink
火狐 gecko
Safari webkit

 

PS:「浏览器内核」也就是浏览器所采用的「渲染引擎」,渲染引擎决定了浏览器如何显示网页的内容以及页面的格式信息。

总结:渲染引擎是兼容性问题出现的根本原因。

三、开发工具

 

四、HTML介绍

1、HTML的概述

html全称HyperText Mackeup Language,翻译为超文本标记语言,它不是一种编程语言,是一种描述性的标记语言,用于描述超文本内容的显示方式。比如字体、颜色、大小等。

  • 超文本:音频,视频,图片称为超文本。
  • 标记 :<英文单词或者字母>称为标记,一个HTML页面都是由各种标记组成。

作用:HTML是负责描述文档语义的语言。

注意:HTML语言不是一个编程语言(有编译过程),而是一个标记语言(没有编译过程),HTML页面直接由浏览器解析执行。

HTML是负责描述文档语义的语言,在html中,除了语义,其他什么都没有。

html是一个纯本文文件(就是用txt文件改名而成),用一些标签来描述文字的语义,这些标签在浏览器里面是看不到的,所以称为“超文本”,所以就是“超文本标记语言”了。

So,接下来,我们肯定要学习一堆html中的标签对儿,这些标签对儿能够给文本不同的语义。

2、HTML的网络术语

  • 网页 :由各种标记组成的一个页面就叫网页。
  • 主页(首页) : 一个网站的起始页面或者导航页面。
  • 标记: <p>称为开始标记 ,</p>称为结束标记,也叫标签。每个标签都规定好了特殊的含义。
  • 元素:<p>内容</p>称为元素.
  • 属性:给每一个标签所做的辅助信息。

 

五、HTML颜色介绍

1.颜色表示

  • 纯单词表示:red、green、blue、orange、gray等
  • 10进制表示:rgb(255,0,0)
  • 16进制表示:#FF0000、#0000FF、#00FF00等

2.RGB色彩模式

  • 自然界中所有的颜色都可以用红、绿、蓝(RGB)这三种颜色波长的不同强度组合而得,这就是人们常说的三原色原理。
  • RGB三原色也叫加色模式,这是因为当我们把不同光的波长加到一起的时候,可以得到不同的混合色。例:红+绿=黄色,红+蓝=紫色,绿+蓝=青
  • 在数字视频中,对RGB三基色各进行8位编码就构成了大约1678万种颜色,这就是我们常说的真彩色。所有显示设备都采用的是RGB色彩模式。
  • RGB各有256级(0-255)亮度,256级的RGB色彩总共能组合出约1678万种色彩,即256×256×256=16777216。

 

 

 

六、HTML的规范

  • HTML是一个弱势语言
  • HTML不区分大小写
  • HTML页面的后缀名是html或者htm(有一些系统不支持后缀名长度超过3个字符,比如dos系统)
  • HTML的结构:
    • 声明部分:主要作用是用来告诉浏览器这个页面使用的是哪个标准。是HTML5标准。
    • head部分:将页面的一些额外信息告诉服务器。不会显示在页面上。
    • body部分:我们所写的代码必须放在此标签內。

1、编写HTML的规范

1)所有标记元素都要正确的嵌套,不能交叉嵌套。正确写法举例:<h1><font></font></h1>

(2)所有的标记都必须小写。

(3)所有的标记都必须关闭。

  • 双边标记:<span></span>
  • 单边标记:<br> 转成 <br /> <hr> 转成 <hr />,还有<img src=“URL” />

(4)所有的属性值必须加引号。<h1 id="head"></h1>

(5)所有的属性必须有值。<input type="radio" checked="checked" />

2、HTML的基本语法特征

  • HTML对换行不敏感,对tab不敏感

  HTML只在乎标签的嵌套结构,嵌套的关系。谁嵌套了谁,谁被谁嵌套了,和换行、tab无关。换不换行、tab不tab,都不影响页面的结构。

  也就是说,HTML不是依靠缩进来表示嵌套的,就是看标签的包裹关系。但是,我们发现有良好的缩进,代码更易读。要求大家都正确缩进标签。

  • 空白折叠现象

  HTML中所有的文字之间,如果有空格、换行、tab都将被折叠为一个空格显示。

  • 标签要严格封闭
<html></html>
<meta />

 

七、HTML结构详解

新建HTML文件,输入 html:5,按tab键后,自动生成的代码如下:

Copy the code
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
Copy the code

1、文档声明头

任何一个标准的HTML页面,第一行一定是一个以

<!DOCTYPE...

开头的这一行,就是文档声明头,DocType Declaration,简称DTD。此标签可告知浏览器文档使用哪种 HTML 或 XHTML 规范。

 

 

XHTML:Extensible Hypertext Markup Language,可扩展超文本标注语言。

XHTML的主要目的是为了取代HTML,也可以理解为HTML的升级版。

HTML的标记书写很不规范,会造成其它的设备(ipad、手机、电视等)无法正常显示。

XHTML与HTML4.0的标记基本上一样。

XHTML是严格的、纯净的HTML

 

以下内容仅做了解:

HTML4.01有哪些规范呢?

首先我们先确定一件事儿,我们现在学习的是HTML4.0.1这个版本,这个版本是IE6开始兼容的。HTML5是IE9开开始兼容的。但是IE6、7、8这些浏览器还不能过早的淘汰,所以这几年网页还是应该用HTML4.01来制作。如今,手机、移动端的网页,就可以使用HTML5了,因为其兼容性更高。

说个题外话,html1 至 html3 是美国军方以及高等研究所用的,并未对外公开。

HTML4.01里面有两大种规范,每大种规范里面又各有3种小规范。所以一共6种规范(见下面):

HTML4.01里面规定了普通XHTML两大种规范。

HTML觉得自己有一些规定不严谨,比如,标签是否可以用大写字母呢?<H1></H1>

所以,HTML就觉得,把一些规范严格的标准,又制定了一个XHTML1.0。在XHTML中的字母X,表示“严格的”。

总结一下,HTML4.01一共有6种DTD,说白了,HTML第一行语句一共有6种:

下面对上图中的三种小规范进行解释:

  • strict:表示“严格的”,这种模式里面的要求更为严格。这种严格体现在哪里?有一些标签不能使用。
    比如,u标签,就是给一个本文加下划线,但是这和HTML的本质有冲突,因为HTML只能负责语义,不能负责样式,而u这个下划线是样式。所以,在strict中是不能使用u标签的。
    那怎么给文本增加下划线呢?今后的css将使用css属性来解决。
    那么,XHTML1.0更为严格,因为这个体系本身规定比如标签必须是小写字母、必须严格闭合标签、必须使用引号引起属性等等。

  • Transitional:表示“普通的”,这种模式就是没有一些别的规范。

  • Frameset:表示“框架”,在框架的页面使用。

在sublime输入的html:xt,x表示XHTML,t表示transitional。
HTML5中极大的简化了DTD,也就是说HTML5中就没有XHTML了(W3C自己打脸了):

<!DOCTYPE html>

 ok,下面重点的来了。

 

 

2、头标签(head)

head标签都放在头部分之间。这里面包含了:<title>、<meta><link>,<style>

  • <title>:指定整个网页的标题,在浏览器最上方显示。
  • <meta>:提供有关页面的基本信息
  • <link>:定义文档与外部资源的关系。
  • <style>:定义内部样式表与网页的关系

 

Meta标签

元素可提供有关页面的原信息(mata-information),针对搜索引擎和更新频度的描述和关键词。

标签位于文档的头部,不包含任何内容。

提供的信息是用户不可见的。 meta标签的组成:meta标签共有两个属性,它们分别是http-equiv属性和name属性,不同的属性又有不同的参数值,这些不同的参数值就实现了不同的网页功能。

常用的meta标签:

  • http-equiv属性

它用来向浏览器传达一些有用的信息,帮助浏览器正确地显示网页内容,与之对应的属性值为content,content中的内容其实就是各个参数的变量值。

 

Copy the code
<!--重定向 2秒后跳转到对应的网址,注意分号-->
<meta http-equiv="refresh" content="2;URL=http://www.luffycity.com">
<!--指定文档的内容类型和编码类型 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<!--告诉IE浏览器以最高级模式渲染当前网页-->
<meta http-equiv="x-ua-compatible" content="IE=edge">
Copy the code
  • name属性

主要用于页面的关键字和描述,是写给搜索引擎看的,关键字可以有多个用 ‘,’号隔开,与之对应的属性值为content,content中的内容主要是便于搜索引擎机器人查找信息和分类信息用的。

<meta name="Keywords" content="网易,邮箱,游戏,新闻,体育,娱乐,女性,亚运,论坛,短信" />

这些关键词,就是告诉搜索引擎,这个网页是干嘛的,能够提高搜索命中率。让别人能够找到你,搜索到。

<meta name="Description" content="网易是中国领先的互联网技术公司,为用户提供免费邮箱、游戏、搜索引擎服务,开设新闻、娱乐、体育等30多个内容频道,及博客、视频、论坛等互动交流,网聚人的力量。" />

 Just set Description page description, then the Baidu search results can be displayed these statements, this technique is called SEO (Search Engine Optimization, Search Engine Optimization).

Results are as follows:

 

 

<meta name=viewport content="width=device-width, initial-scale=1">

Above this label, it is to make our website supports mobile terminal, mobile device priority (to understand)

 

title tags

What are the main mainly used to tell users and search engines This page is a search engine page title can quickly determine the theme of the current page. 

 <Title> Luffy Xuecheng </ title>

Guess you like

Origin www.cnblogs.com/wenwen1230/p/11791292.html