--------- JQ ---------
--------- JS ---------
1. BFC What is ?
BFC (context block level format), creating a new independent BFC box layout, the layout of the box element will not affect the outer box element. margin problem of overlapping in the same BFC two adjacent boxes in the vertical direction occurs
BFC means the browser to create a separate rendering area, the layout of all the elements in the region will not affect the layout area outside elements, rendering this area only block-level element to work.
2. Doctype role ? Strict mode and mixed mode - how to trigger these two models, which distinguish what is the significance ?
( 1), <! DOCTYPE> declaration document located in the front, in the <html> tag before. It tells the parser browser, what type of document to resolve this specification document.
( 2), and JS strict mode layout mode of operation is run to the highest standards of the browser supports.
( 3), in promiscuous mode, the loose pages display backwards-compatible way. Simulate the behavior of older browsers to prevent the site does not work.
( 4), there is no DOCTYPE or incorrectly formatted will result in the document presented in promiscuous mode
3. inline elements What? Block-level elements are there? Empty (void) elements are those?
( . 1) the CSS specification, each display element has attributes, determine the type of the element, each display element has a default value, such as the default display attribute value div "Block", a "block level" element; span The default display attribute value is "inline", is "inline" element.
( 2) the line element has: INPUT SELECT strong ab & span IMG (emphasis tone) block-level element has: div UL OL Li h1 of DL dt dd H2 H3 H4 ... P
( 3) leading empty elements: <br> <hr> <img> <input> <link> <meta> Little is known: <Area> <Base> <COL> <the Command>
<embed><keygen><param><source><track><wbr>
4. CSS selectors What? What attributes can be inherited? How priority algorithm? CSS3 new pseudo-classes are those?
* 1.id selector (# myid)
2. class selector (.myclassname)
3. tag selector (div, h1, p)
4. adjacent selector (h1 + p)
The child selector (ul> li)
6. descendant selectors (li a)
7. Wildcard selector (*)
8. attribute selector (a [rel = "external" ]) can be extended attribute values
9. The pseudo class selector (a: hover, li: nth - child) link vitetd hover active
* 可继承: font-size font-family color, UL LI DL DD DT;
* Do not inherit: border padding margin width height;
* Priority of the principle of proximity, whichever style definitions recently;
* Load Styles to last loaded positioning prevail;
Priority :
!important > id > class > tag
important priority than inline
Example CSS3 new pseudo-class:
p: first-of-type selecting each <p> element belonging to the first parent element <p> element.
p: last-of-type selecting each <p> element belonging to the last parent element <p> element.
p: only-of-type selecting each <p> element belonging parent element only <p> element.
p: only-child selects each <p> element unique child elements belonging to the parent element.
p: nth-child (2) for each selected <p> elements belonging to the parent element of the second subelement.
: Enabled,: disabled control disabled form controls.
: Checked, radio buttons or check box is selected.