Page positioning elements

Source: Internet
Author: User

I. Position property Location page element 1.static: Default value, no positioning. Withdraw from the standard flow of documents 2.relative: relative positioning, relative to the original position of the element to locateNote: When the value of top is positive, move up when negative values move up when the left value is positive and move to the right when negative: 1. Set the relative positioning of the box relative to its original position, by specifying the offset, to reach the new position 2. Setting the relative positioning of the box is still in the standard document flow, it has no effect on the parent box and the adjacent Box 3. Set the relative positioning of the box the original position will be preserved 3.absolute: absolute positioning mi absolute Positioning rule: 1. Use an absolutely positioned element with its nearest "positioned" Ancestor element is offset by 2. If there are no ancestor elements that have been positioned, the browser window will be used as the benchmark for positioning 3. Absolutely positioned elements are detached from the standard document stream, which means that they do not affect the positioning of other elements 4. The position of the element is not retained until it has been offset.4.fixed: Fixed positioning: Fixed positioning with browser as benchmarkSimilar to absolute positioning, but the difference is that the base of the positioning is not the ancestor element, but the browser window 5. Positioning Summary: 5.1 Relative positioning of the property relative to its initial position to locate the position of the element is offset, its original position will be retained down the level of improvement, You can put the elements in the standard document flow and the floating elements in the bottom 5.2 relative positioning of the use of the scene relative positioning is rarely used alone, are used in conjunction with absolute positioning, to create the location of the absolute position of the parent without setting an offset of 5.3 Absolute positioning is positioned relative to its location parent, and if no positioning parent is set, the original position is not raised by the retention level when the position of the element is offset relative to the browser window. You can put the elements in the standard document flow and the floating elements in the bottom set absolutely positioned elements out of the document flow 5.4 Absolute positioning of the use scene in general, absolute positioning is used in the drop-down menu, focus chart Carousel, pop-up digital bubbles, special lace and other scenes 5.5 Fixed positioning properties relative to the browser window to position the offset does not move with the scroll bar 5.6 fixed-position usage scenarios are typically used in Web pages for fixed ads on the left and right sides of the window, back to the top icon, Ceiling navigation bar, etc two. Z-index: the top and bottom position of overlapping layers when adjusting element positioning Z-index Property value: Integer, default value of 0 when the Positon property is set, the Z-index property can set the overlap between each element high and low z-index the value of a large layer above the layer whose value is small set transparency opacity : xx value is 0~1, the smaller the value is transparent Opacity:0.4;filter:alpha (opacity=x) x value is 0~100, the smaller the value the more transparent Filter:alpha (OPACITY=40);

Page positioning elements

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.