A little essay on the front-end and a little essay on the front-end

Source: Internet
Author: User

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}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.