Front end knowledge points

Time:2020-10-4

It mainly records some small notes in work and study. There is no specific technical classification and order. As long as it is related to the front end, it will be put in the bottom, and then collated into a volume later. I hope I can keep updating


1. > > > 0-bit operation

>>>Unsigned right: this operator moves the first operand to the right by a specified number of digits. Bits shifted to the right are discarded and left filled with zeros. The sign bit becomes zero, so the result is always nonnegative

9>>>2
1001->0010//9->2

>>>The meaning of 0: before shifting, the shift operator will convert the data not of type number to type number, and then convert the type of number to the data of 32 bit without sign
32bit conversion rules

  1. If it cannot be converted to number, it is 0.
  2. If it is not an integer, it will be converted into an integer
  3. An integer returns an integer, and a negative number returns the 32nd power of a negative number + 2

X > > > 0 essentially guarantees that x is meaningful (numeric type) and is a positive integer. It is in the range of valid array (0 ~ 0xFFFFFFFF), and it is 0 by default if it is meaningless.

2. The width of TD in table

  • When the table layout property is fixed, each column is equal in width. When the value is auto, the longest column in each column will prevail
  • When the length of the table is 600px, although the width of a two column table is set to 200px, the browser will calculate the width automatically according to the proportion

Front end knowledge points

  • It is also a table with a width of 600. When there are three columns, the width of the first two columns is set to 300, and the width of the last column is not set

The browser’s rendering rule is based on the actual width behind, the remaining width, and the first two columns are equally divided
Front end knowledge points

  • If the width of the first two plus the width of the third unset width element is less than the total width, the first two are displayed at the set size

The third adaptation

3. Easily understood attributes in CSS

:: after pseudo element

The after pseudo element is to add a pseudo element on the last side of the child node where the node is added
Eg: using pseudo elements to remove floats
Front end knowledge points
It is easy to mistakenly understand as adding pseudo elements after BFC elements
In fact, we should add a pseudo element after the last child element of BFC

:first-child

The explanations and examples in the rookie tutorial are
Matches the first < p > element of the parent element of the < p > element
Front end knowledge points
But here’s the situation
Front end knowledge points
Therefore, when the element is followed by first child, the element must be the first child element of the parent element to take effect
The same is true when an element follows a class name
Front end knowledge points
The premise is that faketest has a faketest class in addition to the first child element of its parent element
Front end knowledge points
After changing the order, the style does not take effect

: margin left: percentage

This attribute is often used, but when the attribute is a percentage
Represents the percentage of the parent element of the element
Front end knowledge points

Then we can see the wrong description on w3school website (March 26, 2020)
Front end knowledge points