Million annual salary python road - HTML base

A. Web standards

web standards:

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

Summary description:

  • 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

img

II. Introduction browser

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

img

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.

3. HTML Introduction

The nature of Web services

import socket

sk = socket.socket()
sk.bind(("127.0.0.1", 8080))
sk.listen(5)
while True:
    conn, addr = sk.accept()
    data = conn.recv(8096)
    conn.send(b"HTTP/1.1 200 OK\r\n\r\n")
    conn.send(b"<h1>Hello world!</h1>")
    conn.close()

The requesting browser -> HTTP protocol -> server receives the request -> response returned from the server -> server the HTML file content to the browser -> browser rendering the page

What is HTML?

html stands for HyperText Markup 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只是负责描述文档语义的语言,在html中,除了语义,其他什么都没有。

html file is a plain text (txt file by the change from extension), with some of the text label that describes the semantic

The term HTML network

  • Pages: a page from a variety of labels through the page is called.
  • Home (Home): a start page or navigation page URL, usually the home page html file called index.html
  • Tags <h1> called start tag,

    Called the closing tag, also called tags, each tag ordained a specific meaning.
  • Element: <h1> element
  • Properties: auxiliary information for each tag, eg:

    element

    name is the attribute name, p1 is the property value.

HTML structure is divided

  • 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 need to show up written code must be placed within this tag.

HTML specification

1. All labeling elements should be properly nested, nesting can not cross. 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">

5. All attributes must have a value. <Input type = "text" name = "username">

HTML basic syntax

1. The label should be strictly closed
<html></html>
<br />
2. Multiple spaces, line breaks, Tab will and into a space

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

3. not sensitive to wrap and 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.

4. HTML structure

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

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

4.1 documentation states that the head

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

<!DOCTYPE html>

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.

4.2 Label (head)

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

  • < title>: Specifies the whole page title is displayed at the top of the browser.

    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>路飞学城</title>

    Results are as follows:

    img

  • < meta>: Provides basic information about the page

    Element provides meta information about the page (mata-information), and description for search engines update frequency and keyword.

    Label is located on top of the document does not contain any content.

    Information provided by the user is not visible. Consisting of meta tags: meta tag has two attributes, they are http-equiv and name attributes, different attributes have different parameter values, these different parameter values ​​to achieve a different page functions.

    Common meta tags:

    ##### http-equiv attribute

    It is used to convey useful information to the browser help browser correctly displays Web page content, the corresponding attribute value content, the content is actually the content of the variables of each parameter value.

    <!--重定向 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">

    ##### name attribute

    Mainly for the keywords and description of the page, the search engine is written to see, there may be a plurality of keywords with ',' number of spaced, content attribute values ​​corresponding thereto, the content of the main content is to facilitate the search engine robot find information and use of classified information.

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

    These keywords is to tell the search engine, the website is doing, can improve search hits. So that others can find you, search.

    < 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:

    img

    
    < 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)

  • < link>: Definition of the relationship between a document and an external resource.

  • < style>: Definition of the relationship between internal pages and style sheets

Extension: html color representation

Color representation

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

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.

html Color Code table

Guess you like

Origin www.cnblogs.com/zhangchaoyin/p/11493676.html