The first front-end learning summary

summarize

One,  H TML

  1. H TML : refers to the HTML ( H yper Text Markup Language ), which is not a programming language, but a markup language used to define and document structure .
  2. H The TML Tags: usually appear in pairs (eg: < P> </ P> ) of the first tag label also start tag, the second tag is an end tag.
  3. H The TML comments written format: < -! - annotation content - - >, is used to describe the function codes, browser parses H The TML not parse-time code annotation content. 
  4. HTML elements: an important part of an HTML document, an HTML document is composed of a large number of elements, all HTML content in the structure, are organized into pages by the elements.
  5. Part of the HTML element: < H3> SUMMARY </ H3> ( < H3>: represents a start tag; </ H3> : represents the end tag; < H3> </ H3> : denotes H . 3 . Elements)
  6. Empty elements: no element content and the end tag, (e.g., < IMG the src = "img.jpg" Alt = " image " ); notation <tag attribute name > .
  7. Hierarchy of elements: an element may contain other elements, nested hierarchical structure formation (e.g., < A> <P> SUMMARY </ P> </ A > ); but it can not be nested (e.g., between the two elements of each < a> <p> SUMMARY </a> </ P> ).

<html>

  <head>

     <p></p>

  </head>

  <bady>

      <a></a>

  </bady>

</html>

Html element directly contains the head and bady element, the HTML element is the parent element head and bady elements, head and bady element as a child of HTML, head, bady each other siblings,

 

Two,  C SS

  1. CSS Note: The format of / * footnotes * / , used to describe the function of the code, the browser parses C SS will automatically ignored when the code.
  2. C SS rule: C SS code consists of a number of rules, each rule specifies: What style elements for which application. (E.g. H . 1 {Color: Red; text-align = left: Center;} represents a rule, H . 1 represents a selector, "Color: Red; text-align = left: Center" indicates declaration block).

C olor: indicates the color text-align: Content-Location,    

F ONT-size: represents the font size; text-indent: indentation,

B Order: 1px Solid Red represents red solid border.  

  1. CSS rules - selector

a)  element selector: writing format: name tag { / * declaration block * / } , all the elements that match the tag name, the rule will be defined by the declaration block.

b)  class selector: writing format: Class Name { / * declaration block * / }, all class attribute specifies the class name of the element, it will be defined by the rule declaration block.

C)  the I D Selector: writing format: # ID value { / * declaration block * / }, for the specified attribute ID of elements to the block is a declarative rules, a document element in the I D is unique.

  1. C SS applications :

a)  an external style sheet : the CSS code in a separate file in the HTML page with a reference to the link element. (E.g. <Link the rel = " this stylesheet " Herf = "the main.css">, the rel represents resources used stylesheet, Herf = "" in the path table writing style. ) 

External style sheet features: content structure to achieve the separation of code and forms for easy reuse and maintenance; the HTML code more pure, help programmers read and search engines ; to develop common practices page 

b)  internal style: the C SS code is written in a style element in the HTML document content.

<head>
    <meta charset="UTF-8">
    <title>我的第一个页面</title>
    <style type="text/css">
        h1{color:red;text-align: center;}
        p{text-indent: 2em;color:chocolate;font-size:18px;}
    </style>
</head>

Internal Style Features: no style sheet file, in some cases can improve efficiency; more difficult to share the page style is not conducive to code reuse ; HTML and CSS code promiscuous, is not conducive to search engine programmers and reading ; in some of the efficiency using the following test scenarios demanding or c inline style : the CSS code is written in the element style properties, not written inline style selector

Features: no style sheet file, in some cases can improve efficiency; more difficult to share elements of style is not conducive to code reuse ; HTML and CSS code promiscuous, is not conducive to search engine programmers and reading ; JavaScript is operated inline style ; used in the test scenario

 

 

Guess you like

Origin www.cnblogs.com/caoxiangwang/p/11258824.html