Location: The place where the position is determined, identified or pointed, and the boundary of the property is determined by the location or boundary (e.g. through reconnaissance).
The content in CSS about positioning is: position:relative | Absolute | static | Fixed Static does not have special settings, follow the basic positioning rules, can not be graded by Z-index hierarchy. In this article flow, any element is constrained by the text flow of its own position, but through the CSS we still make these elements can change their position, we can float to let the elements floating, we can also use margin to let the element to create position movement.
1. The absolute positioning and relative positioning in CSS is described in detail
The hierarchy relationship is:
<p ——————————— position:relative; Not the nearest ancestor-positioning element, not a reference.
<p —————————-not set to anchor element, not reference
<p ———————-position:relative Reference
<p Box1
<p Box2--–position:absolute; top:50px; left:120px;
<p Box3
2. Introduction to the relative positioning and absolute positioning of CSS
Generally if we do not set position for an element, the default is static, at which point the element is not positioned, and the offset properties like left/right are not effective.
3. Comprehensive understanding of absolute positioning
Because the position of the element is relative to its position in the normal stream. The position of an absolutely positioned element is relative to the nearest positioned ancestor element,
If an element does not have an ancestor element that has been positioned, its position is relative to the original containing block.
Not set before positioning is a large box wrapped in a small box that conforms to the standard document flow, as shown in the sheet
4. Web front-end question eighth-absolute positioning and relative positioning
Relative positioning (relative):
First of all, relative positioning: the same as its name, relative, to have a reference, but this is not another, it is its own position in the original document flow. The object after the relative positioning is not completely detached from the document stream, where the object is retained in the document (standing Manger not to poop), and the offset object will mask the other layers.
5. Three basic positioning mechanisms in CSS
There are three basic positioning mechanisms for CSS: normal flow, floating, and absolute positioning.
Unless specifically specified, all boxes are positioned in the normal stream. That is, the position of an element in a normal stream is determined by the position of the element in the (X) HTML.
Block-level boxes are arranged from top to bottom, and the vertical distance between boxes is calculated from the vertical margin of the box.
6. Summarize the four positioning properties common in CSS (left right top bottom)
DIV CSS left right top bottom Locate the four CSS property styles used to locate the object box, you must define the Position property value to absolute or relative.
The distance from the left of the current element to the left side of the parent element (which is the original default position).
The distance value to the right of the current element to the right of the parent element.
Top the distance from the top of the current object that is above the original position.
Bottom the distance from the original position at the bottom of the current object
7. Parsing the difference between relative and absolute in the position of CSS
Position has the following properties: Static, Inherit, fixed, absolute, relative
The first three good understanding good differentiate:
Static: Is the default state, there is no positioning, the element appears in the normal stream (ignoring top, bottom, left, right or Z-index declaration).
Nherit: Inherits the value of the Position property from the parent element.
Fixed: Generates an absolutely positioned element that is positioned relative to the browser window. (That is, when scrolling the browser, the element is permanently displayed in a location in the window's viewable area).
What is the difference between absolute and relative, which is commonly used and will cause beginners to confuse?
8. HTML CSS decision positioning, filters detailed Introduction
. position:relative; relative to Bit
Does not affect the characteristics of the element itself;
Do not leave the element out of the document flow;
If there is no positioning offset, there is no effect on the element itself;
Positioning element Position control: Top/right/bottom/left;
The Overflow:hidden of the parent under the IE6 is the relative positioning of the subset that cannot be wrapped;
Add positioning elements to the parent level;
When the parent width height of the anchored element under IE6 is odd, the bottom and right of the anchor element will have
Deviation of 1px
9. CSS positioning (positioning) | CSS Online Brochure
CSS positioning properties allow you to position a single element. It can also put an element behind another element and specify what should happen when the content of an element is too large.
Elements can be positioned using the top, bottom, left, and right properties. However, these properties do not work unless the Position property is set first. They also have different ways of working, depending on the location method.
There are four different positioning methods.
Related Questions and answers:
1. Html-css How to realize how the red message below is positioned on different phone widths
2. css-html location problem percentage and padding marggin border conflict