Absolute: Absolute positioning, CSS writing "Position:absolute;" ", it's positioned in two different situations, as follows:
1. Do not set top, right, Bottom, left, the default based on the parent "content area original point" as the original point, the above example red Section (the parent yellow area has the Padding attribute, "coordinate original point" and "content area original point" is not the same).
2. There are set top, right, Bottom and left, here are divided into two kinds of situations:
(1). The parent is not position property, the upper left corner of the browser (that is, the body) for the "coordinate original point" for positioning, position by top, right, Bottom, left property, the above example green part.
(2). The parent has the position attribute, and the parent's "coordinate original point" is the original point, the example light blue section above.
Relative: relative positioning, CSS writing "position:relative;" ", reference to the parent's" content area origin "as the original point, no parent is the body's" content area original point "as the original point, the position by the top, right, Bottom, left property, and there is" open or occupy the height "of the role, above the example orange part.
Through the above examples and explanations, I believe that skilled use of absolute and relative is not a very difficult thing, we are surrounded by a lot of absolute and relative good examples, such as "NetEase 163 free Mail" Home (http://mail.163.com ), there is a lot of use.
Example code is passed in IE5.5, IE6, FF1.5, Opera9 tests.
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.