2.2.2 relative positioning
Relative positioning is a very easy-to-understand concept. If an element is relatively located, it appears at its location. Then, you can set the vertical or horizontal position to move the element "relative to" its start point. If you set top to 20 pixels, the box will show 20 pixels at the top of the original position. If left is set to 20 pixels, a 20 pixel space is created on the left of the element, that is, the element is moved to the right (see Figure 2-10 ).
"Position:absolute"It means: He means absolute positioning, he is by default referring to the upper left corner of the browser, with top, right, BOTTOM, left (hereinafter referred to as TRBL) for positioning, with the following properties:1) If there is no TRBL, in the upper-left corner of the parent, when there is no parent, he refers to the upper-left corner of the browser, and if there is no parent element, the text is in front of it.The top right
I. Let's look at two examples.
1. XHTML
Code
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
Body
>
Div
Class
= "Relative"
>
Span
Class
= "Absolute"
>
Test absolute
Span
>
Div
>
Body
>
2.css code
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-
From: http://www.jb51.net/css/34227.html
1. When the width of the floating layer adjacent to the absolute positioning layer is not equal to the width of the parent layer, and the floating layer is not cleared, IE6/7, FF are consistent;2. When the width of the floating layer adjacent to the absolute positioning layer is not equal to the width of the parent layer, IE6/7 does not display the
Relative references and absolute references
A relative reference is the default reference for a WPS table, so the references we use in general are relative references. A relative reference is when you copy a cell's formula to another cell, the position of the cell referenced in the formula changes accordingly.
The most common use of relative references is to populate the formula. For example
In the table above, fill in the formula "=sum
First, the basic concept
1, relative path-as the name implies, the relative path is relative to the current file path. Web pages typically represent paths using this method.
2. Absolute path-Absolute path is the real path on the hard disk of the file or directory on your home page. The absolute path is the real path on the hard drive of the file or directory on y
Deep understanding of absolute CSS positioning, deep understanding of CSS positioning* Directory [1] define [2] features [3] display [4] clip [5] in front of overflow
We have already introduced the positioning offset and stack. In this example, a large number of applications have applied absolute positioning. Compared with relative positioning and fixed positioning, abs
Absolute layout and relative layout for IOS development (screen adaptation)If you have worked on Web Front-end pages before, you can see that absolute positioning and relative positioning are no stranger, and they are easy to use. In ios ui design, there are also absolute and relative positioning, which are different from the
Let's take a look at two pieces of code: Code 1: Access [php] with a relative address lt; metahttp-equiv quot; Content-Type quot; content quot; text/html; charsetGBK quot; gt; lt ;? Phpecho $ _ SERVER [ amp; #39; DOCUMENT_ROOT amp;
See the following two sections of code:
Code 1: access from a relative address
[Php]
Echo $ _ SERVER ['document _ root'];?>
Code 2: absolute address access
[Php]
Echo $ _ SERVER ['document _ root'];?>Let's put
See the following two sections of code:
Code 1: access from a relative address
[Php]Echo $ _ SERVER ['document _ root'];?>
Code 2: absolute address access
[Php]Echo $ _ SERVER ['document _ root'];?>Let's put the two in the first place, and let's talk about the pure html code (ps: Now it's a test, so I will write a simple point, but the result can be obtained)
Code 1: relative address (test_image_1.html)
[Html]Code 2:
Positioning Tags: positionInclude attribute: relative (relative) absolute (absolute)1.position:relative; If you are relative to an element, first it will appear where it is located. It then moves the element "relative to" its original starting point by setting the vertical or horizontal position. (again, relative positioning, regardless of whether or not to move, the element still occupies the original spac
Relative positioning:When the elements are set relative or absolutely positioned, the cascade is automatically generated , and their cascade level is naturally higher than the text flow unless set to a negative value of z-index.And we find that when the relative positioning element is shifted, the surface is out of the text flow, but in fact in the flow of the original relative positioning left the original total width and total height.Absolute positioning:Relative positioning can only be moved
1. Understanding of Basic concepts
Absolute path: Absolute path is the true path of the file or directory on your home page on your hard disk, (URL and physical path) For example: C:\xyz\test.txt represents the absolute path of the Test.txt file. Http://www.sun.com/index.htm also represents a URL absolute path.
Relat
Currently almost all major browsers support the position attribute (except "Inherit", "Inherit" does not support all including IE8 and previous versions of IE, IE9, IE10 has not been tested), the following is w3school to position five value interpretation, A friend you need can refer to the followingAmong them, absolute and relative are the most commonly used, fixed used more (where IE6 does not support fixed).1,
In the previous article, I talked about the
meaning and writing methods of absolute and relative paths
, so some friends asked when to use absolute paths. When to use a relative path.
They have their own advantages and disadvantages.
When in fact there is no absolute answer using absolute and relative paths
,
The positioning in CSS2.0 does sometimes confuse people, so write it down today and check it out later. The following is a part of the content of the W3cschool and divcss5 the two official website, here specifically to explainCSS2.0 position is mainly used for the positioning of HTML elements, which is very useful in practical design. But for learners, they will encounter relative positioning and absolute positioning in the end how to use, very hit sk
The positioning in CSS2.0 does sometimes confuse people, so write it down today and check it out later. The following is a part of the content of the W3cschool and divcss5 the two official website, here specifically to explainCSS2.0 position is mainly used for the positioning of HTML elements, which is very useful in practical design. But for learners, they will encounter relative positioning and absolute positioning in the end how to use, very hit sk
I. Basic CONCEPTS
1, relative path-as the name suggests, relative path is relative to the current file path. The Web page generally indicates that the path uses this method.
2, absolute path-absolute path is your homepage on the file or directory on the hard drive real path. The absolute path is the real path to the file or directory on your home page, for exampl
Positioning Tags: position
Include attribute: relative (relative)
Absolute (absolute)
1.position:relative; If you are relative to an element, first it will appear where it is located. It then moves the element "relative to" its original starting point by setting the vertical or horizontal position. (again, relative positioning, regardless of whether or not to move, the element still occupies the original s
CSS Positioning propertiesPosition: Place elements in a static , relative , absolute , or fixed position.Top: Defines the offset between the top margin boundary of an anchored element and the upper boundary of its containing block .Right: Defines the offset between the left margin boundary of the anchored element and the right boundary of its containing block .Bottom: Defines the offset between the margin boundary under the anchor element and the lo
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.