Compatible yu comparison

1.1, inline-block 4px gap to remove spaces

  Use negative margin values

  use font-size:0

  letter-spacing

  word-spacing

 

2.1、src vs href

src is used to replace the current element, and href is used to establish a link between the current document and the referenced resource.

src is the abbreviation of source, which points to the location of external resources, and the pointed content will be embedded in the location of the current tag in the document; when the src resource is requested, the resource pointed to by it will be downloaded and applied to the document, such as js script, img image and frame and other elements.

<script src =”js.js”></script>

When the browser parses this element, it will suspend the downloading and processing of other resources until the resource is loaded, compiled, and executed. The same is true for elements such as pictures and frames, which is similar to embedding the pointed resource in the current tag. That's why the js script is placed at the bottom instead of the head.

href is the abbreviation of Hypertext Reference, which points to the location of the network resource, establishes a link with the current element (anchor) or the current document (link), if we add in the document

<link href=”common.css” rel=”stylesheet”/>

Then the browser will recognize the document as a css file, will download the resources in parallel and will not stop processing the current document. This is why it is recommended to use the link method to load CSS instead of the @import method. 

 

2.2, the relationship between display, float, position 

If display is none, neither position nor float work, in which case the element does not generate a box

Otherwise, if the position value is absolute or fixed, the box is absolutely positioned, the computed value of float is none, and the display is adjusted according to the table below.

Otherwise, if float is not none, the box is floated and the display is adjusted according to the table below

Otherwise, if the element is the root element, display is adjusted according to the table below

In other cases, the value of display is the specified value

To sum up: absolute positioning, floating, and root elements all need to adjust the display display conversion rules 

Guess you like

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