(Note: The content in this document is the content accumulated in other blogs and videos. If there are any mistakes, please also point out them and we will modify them after you see them.)

Html5 supports quick query of tags

www.html5star.com/manual/html…

Querying the compatibility of CSS properties

www.caniuse.com/

Vscode quickly generates code:

(Drag the middle mouse button to select the code in batches)

Format:

(h \[id=”id\[id=”id\[id=”id”]*5>{$contents})*2

The equivalent of

A content

2 content

3 content

Four content

Five content

A content

2 content

3 content

Four content

Five content

Random fake text (vscode)

Quick use: Lorem word count

Such as:

Lorem20

Results: Lorem ipsum dolor, sit amet consectetur adipisicing elit. Accusamus vitae repudiandae commodi blanditiis ad ut fugiat sequi eius neque soluta!

dedent

shift+Tab

HTML entity character

1) & words

Such as:

Less than:”

More than: >

Space:

Copyright: ©

Ampersand: &

2) &# number

The map element

www.w3school.com.cn/tags/tag\_m…

The origin is in the upper left corner, x horizontally, y vertically

(It can be understood as: usage method similar to Canvas)

Figure element

A figure element is a combination of elements, optionally with a title. The figure tag is used to represent a single piece of content on the site’s production page. If it is removed from the page, it will not affect the rest of the page. Figure can be an image, a statistical graph, or a code example.

Such as:

<img SRC ="shanghai_lupu_bridge.jpg" width="350" height="234" /> </figure>Copy the code

Audio and video formats compatible:

<audio controls>
   <source src="horse.ogg" type="audio/ogg">
   <source src="horse.mp3" type="audio/mpeg">
 Your browser does not support the audio element.
</audio> 
Copy the code

List elements:

Ordered list:

ol>li

Unordered list:

ul>li

Define a list:

Dl >dt (dt: title)

Dl > DD (DD: Glossary description)

Container element

Header: header

Footer: the footer

Article: Usually refers to the whole article

-Leonard: Section

Aside: Side bar

Nav: navigation

Element inclusion relation

Block-level elements can contain row-level elements, and row-level elements cannot contain block-level elements

Such as:

H element (tag) cannot contain P element (tag)

H elements cannot contain div elements

The font

Fonts are divided into serif and non-serif fonts

The selector

Element selector: The name of the element (tag)

(PS: It is not recommended to be used in general, because it will be inconvenient to change the interface if it is greatly changed later)

Id selector: #id

Class selector:.class

Wildcard selector: *

Property selector: [Property value = value]

Pseudo-class selectors: for example :hover, :link

Ps :{the general order is:

1) Link (unaccessed state),

2) The state after the visit

3) hover (mouse)

4) Active (The state when the mouse is pressed but not released)

}

Pseudo-element selectors: for example ::before, ::after

Selector combination:

1) Contains the selector: space (e.g. #header p)

2) Child element selector: > (e.g. Div > span)

3) Adjacent selector: + (e.g..red+li (element whose class is red and whose next element is li))

4) Sibling selector: ~ (for example:.red+li (the sibling of the next element whose class is red and whose class is li))

5) Juxtaposing: commas (e.g..red,.content)

cascading

1. Importance :(from high to low)

1)! Important (try not to use)

2) Common styles in style (including styles in CSS files and style properties)

3) Browser default style

2. Particularity:

Look at the selector: The narrower the selector is, the more special it is

Specific rule: through the selector, calculate a four digit (256 base, every 255 1, starting from 0)

1) first: if the style is inline, the counter +1 (for example, in an HTML file)

Background-color :red; background-color:red

#content{background-color:red} #content{background-color:red} #content{background-color:red} #content{background-color:red} #content{background-color:red}

3) Third bit: number of all class selectors, property selectors, pseudo class selectors (e.g..class, [], :class)

4) Bit 4: number of all element selectors, pseudo element selectors (e.g. : div, ::after)

3. Compare source order

Code written late wins (personal use)

inheritance

Most font and text content properties in CSS are inherited from parent elements to child elements

So: to set the font for an HTML page, select body, and then set the font information in the body

The property is worth the calculation process

1) Determine the declared value

No conflicting declarations, directly as CSS properties

2) Cascading conflicts

For conflicting declarations of stylesheets, use cascading rules to determine CSS property values

3) Use inheritance

If there is still no value, use inheritance for values that can be inherited, inheriting the value of the parent element

4) Use the default value if no value exists, use the default value

Two special CSS values

The value of the parent element :inherit (e.g. Color :inherit)

Initial value :initial (e.g. color:initial)

Row boxes and block boxes

1) Row box: disaplay:inline

  1. Block boxes: display: block

3) Inline block: display:inline-block

A box model of a row box

Distinctive features

1) The box extends along the content

2) The width and height of row boxes cannot be set

3) The padding is effective in the horizontal direction, while the vertical direction only affects the background and does not actually occupy space

4) The border is effective in the horizontal direction, while the vertical direction does not actually occupy space

5) Padding is effective in horizontal direction, vertical direction does not actually occupy space

Box model of inline blocks

1) Don’t monopolize a row

2) All sizes in the box model are valid

Normal flow layout

Also known as: Regular flow, document flow, regular document flow, regular document flow

The combination of top and bottom distances

Two regular flow block boxes with adjacent upper and lower margins are merged

For details, please see: (zhuanlan.zhihu.com/p/25321647, landing the principle)

Float (Float: High compatibility) (Flex can replace most of float’s features)

arrangement

1) Left: float left, element up and left

2) Right: float right, element up and right

3) Default: None

4) Floating boxes will avoid regular flow boxes when they are arranged in inclusion speed

5) The conventional flow box is in the arrangement, ignoring the floating box

  1. Margin merging does not occur

The basic characteristics of

1) When an element floats, it must be a block box

2) Floating elements contain fast, box regular streams like the content for the parent element

The box size

1) If the width is auto, it means to adapt the content width

2) The height is auto, which is consistent with the normal flow and ADAPTS to the content height

3) If margin is auto, 0

4) Row boxes will avoid floating boxes when they are arranged

5) If the text is not in the line box, the browser automatically generates a line box to wrap the text (the line is called anonymous line box).

The height of collapse

1) The root cause of height collapse: when calculating the automatic height of conventional flow boxes, floating will not be considered

2) Clear floating: CSS property: Clear

– Default: None

-left: Clears the left float. This element must appear below all previous left float boxes

– right: Clears the right float. This element must appear below all previous right float boxes

-both: Clears the right float. This element must appear below all previous float boxes

3) No clear float is used to solve the problem of height collapse:

Add the property overflow: Hidden to the floating parent element;