The composition of web pages (1)

html: the skeleton of the web page

Hypertext Markup Language. Explain, hypertext: popular will be beyond plain text (just text), that is to say, there are other content besides text, such as music, video, etc.; "tag" <html></html> indicates that it is html .

  • Speaking of html, not to mention the issue of browser compatibility, what works is the browser's kernel (rendering engine), then the current kernels: Trident (IE kernel), Gecko (Firefox kernel), Webkit (Safari kernel) , Chrome kernel prototype, open source), Blink (Chrome).
  • Web server: Web server generally refers to a website server, which refers to a program that resides on a certain type of computer on the Internet . It can provide documents to Web clients such as browsers, and can also place website files for the world to browse; it can place data files. , let the world download. The three most popular web servers are Apache Nginx IIS.
  • The composition of the web page: html (equivalent to the skeleton of the human body), css (style), javaScript (action, which can make static content dynamic)

The composition of html: <html></html> root tag <head><title></title></head> header <body></body> body

        Recommended use: Recommended because it is more semantic and easier for browsers to read.

  1. h1-h6 title tags: fonts are larger and smaller
  2. front: font label
  3. strong (recommended): bold ------ b
  4. em: text italic (recommended) ------ i
  5. del: delete, that is, the text is underlined (recommended) ---- s
  6. ins: underline label (recommended)----u
  7. img: image tag: src--source alt----when the text cannot be displayed, display the value of alt; title---prompt text, that is, when the mouse is placed on the image, the content of the text will be displayed . width: width, height: height
  8. a: hyperlink---href: the connection to be jumped, target: the way the window is opened, _self (default, open in the current window), _blank (open in a new window), of course, the hyperlink is opened in the window method, you can set the opening method uniformly, <base target = _self or _blank></base> (note that it is set in the head) -- go back to the previous page;
  9. p: paragraph tag
  10. ol and ul ordered lists and unordered lists
  11. embed Music Tags
  12. scroll label <marquee direction="" behavior="slide"> look at me look at me. . . . </marquee> can be used as a bullet screen, or a website announcement

 javascript: make web pages more dynamic and attractive

In 1995, sun company launched java, and the whole world was shocked by this language. Netscape executives decided to develop a language similar to java, but simpler than java language. It was developed by Brandon Eich, who only developed 10 languages. day completed.

In December 1999, ECMAscript 3.0 was released and became the general standard of JavaScript.

Know javaScript:

The composition of javaScript: 1.ECMAScript---> the syntax standard of javaScript. 2.DOM: Manipulate elements (that is, tags) on the web page 3.BOM: The API of javaScript to manipulate some functions of the browser.

Features of javascript:

  1. Simple and easy to use: Works with a large number of editing tools; only requires a browser to execute.
  2. It is an interpreted language, that is, it does not need to be compiled, it can be loaded and executed directly, and it is executed line by line and its variable types are represented by var.
  3. It is also object-based, with a large number of built-in objects, so that when developing, the amount of code development can be reduced.

What is the scope of use of javascript:

  1. The verification of the form, for example: verifying that the user name cannot be empty, the maximum number of characters, etc., is the so-called asynchronous verification.
  2. Invocation of the browser object.
  3. Browser object's events.
  4. Validation of client data.
  5. The effect displayed on the special page of the web page.

JavaScript syntax specification:

  1. Inline and html, in <head><script>js code</script></head>.
  2. Download the script code into a separate js file, and then reference the js file in html (recommended: because the coupling between the codes is reduced, which is convenient for later maintenance and management).

 Small principles in the process of JavaScript execution:

  After the <script> tag appears in the html, it will stop and wait for the loading and parsing of the script, so it is best to put the <script> tag below the body, so that the page can be loaded first, reducing the impact on the page, and secondly, the js that can be merged files, preferably combined.

The syntax of javaScript:

Note that: javaScript is case-sensitive, and the definition of variables must start with a character or an underscore. It is forbidden to use the reserved keywords of javaScript as variable names.

JavaScript data types:

      Simple type:

  • string
  • Number
  • boolean
  • undifine: Indicates that the value is "empty" and has not been initialized.
  • null: Null Type: It is a keyword in JavaScript that is usually used to describe null values.

       complex types:

  • Object: Object
  • Array: Array

 special words:

Infinity: means infinity: 1/0

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326276236&siteId=291194637