A little essay on the front-end and a little essay on the front-end
Mr. Xiaolong asked me to write an article based on my own knowledge, but I thought about what I thought (embarrassing ..), so let's write a simple knowledge point: First, let's talk about positioning. It feels very important. 1. Relative positioning: position: realative (relative to the previous position that has not been located) it has the following features: it does not break away from the document stream, and does not affect the features of the element itself. The block level is block level, and the row level is relatively located at the row Level 2: position: absolute has the following features: (1 ). it is located relative to the parent-level element that has already been located (what if the parent-level element is not located? Then I went up and looked for my father. What about my father's positioning? Next, look up. If there is no parent, it is relative to the body) (2 ). separated from the document stream (completely separated) 3 fixed position: fixed (fixed position relative to the window) What does this positioning attribute mean? The positioning method of an element is similar to that of absolute, but its contained block is the view area itself. On-screen media, such as a WEB browser, elements are not moved in the browser when the document is scrolling/* How To Make A box absolutely centered in the page according to positioning two methods: 1.div{ position: absolute; top: 0; left: 0; right: 0; bottom: 0; margin: auto;} 2.div{ position: absolute; top: 50%; left: 50%; margin-top: -100px; margin-left:-100px;} */2: Finally, let's talk about the floating clearing method. Let's talk about a mainstream method :: after method: (Note: Act on the parent of the floating element) div: after {content: "" display: block; clear: both}