Example:
2. Position : absolute Absolute position:1. There is no position: absolute (or relative) on the outer layer; then the div is positioned relative to the browser, as shown in the figure below (50 pixels from the right border of the browser and 20 pixels from the lower border).
2. The outer layer has position: absolute (or relative); then the div is positioned relative to the outer layer border, as shown in the figure below (50 pixels from the right border of d, and 20 pixels from the lower border of d).
Example:
3. Position : relative Relative position:As shown in the figure below, it is fixed relative to a certain position of the div that contains this div. If the outer layer does not contain his, it will be fixed relative to the browser.
Example:
4. Layering ( z-index ) Layering in the z -axis direction can be understood as dividing into a stack of paper, and the higher the number of layers, the higher the upper.In the example above, we see that aa covers a, because the display level of the later code is higher, so how can a cover aa without changing the order of the code. as follows:
Example:
5. float : left , right When Left and right , you don’t need to specify a location ( left and top ), but it is directly relative to the browser. If the outside is wrapped, the upper left or upper right of the position of the removed row relative to the external div is displayed. Additional: 1. overflow: hidden; //Hide beyond the part; scroll, display the scroll bar;<div >/div> //Truncate the flow
2. Cursor: The shape of the pointer mouse when it points to it;
3. Translucent effect:
<div class=box>Transparent area<div>
The code in the stylesheet is:
.box
{
opacity:0.5; -moz-opacity:0.5; filter:alpha(opacity=50)
}
To sum up the practice example: Part of the format layout of the ADVA website
html code: XML/HTML Code Copy content to clipboard