15th Chapter Positioning
static
Static positioning (not changing its position, where it is)
The default value. No positioning, the element appears in a normal stream (ignored top
, bottom,
left, right
or z-index
declared).
fixed
Fixed positioning (Reference-browser window)---do pop-up ads
relative
(relative positioning) (with reference to himself)
absolute
(absolute positioning) (except static
as you can, find the reference and position it with the nearest parent that has been positioned)
Creates an absolutely positioned element that static
is positioned relative to the first parent element other than the anchor.
The position of the element is defined by "," and left"
"top"
"right"
"bottom"
attributes
Z-index
z-index
property to set the stacking order of the elements. Elements that have a higher stacking order are always in front of elements that are lower in stacking order.
The basic idea of positioning: it allows you to define where the element box should appear relative to its normal position, or relative to the parent element, another element, or even the location of the browser window itself.
Everything is a box
Block-level elements: div
, h1
or p
elements that are: displayed as a piece of content called "Block box";
Inline elements: span
, strong
, and a
so on, the content is displayed in the line called "inline box";
Use the Display property to change the type of box to display:block
be:; Set inline elements to block-level elements, display:none;
no boxes
Relative positioning:
If a element is positioned relative to it, it will appear where it is located.
Move the element "relative to" its starting point by setting a vertical or horizontal position
.adv_relative { position: relative; left: 30px; top: 20px; }
Absolute positioning:
The position of the element relative to the nearest positioned ancestor element, if the element has no positioned ancestor element, its position is relative to the original containing block..adv_absolute { position: absolute; left: 30px; top: 20px; }
、
16th Chapter Framework
frameset
Framework:
rows
, cols
attributes
Frame Sub-framework
src
The path to the displayed page
name
Frame name
frameborder
Border Line (value 0/1)
< frame
>----represents a part of a frame; a single label, to follow the end flag
< noframes
> Properties
< noframes
> provides content that is not supported by a frame browser body
; double label
<frameset>
<frame src= ""/>
<frame src= ""/>
<frame src= ""/>
<noframes>
<body> content </body>
</noframes></frameset>
<iframe>
Inline frame
iframe
Element creates an inline frame that contains another document (inline frame)
Allow and body
use together
width
Width (value px/%)
height
High (value px/%)
name
Frame name
frameborder
Border Line (value 0/1)
src
The path to the displayed page
17th Chapter CSS Advanced Properties
{
opacity:0.5;
Filter:alpha (opacity:50);/*0-100*/
-moz-opacity:0.5; /* Value 0-1*/--> resolution for early version of Firefox compatibility problem}
Appendix I of the third part of the Div naming specification
---
---
Appendix Two CSS Sprites
a {display:block;
width:200px;
height:65px;
line-height:65px; /* Define Status */
text-indent:-2015px; /* Hide Text */
Background-image:url (button.png); /* Define background picture */
background-position:0 0; /* Defines the normal state of the link, at which point the image shows the top part */
}
a:hover {background-position:0 -66px; /* Define the slip-over state of the link, at which point the middle part is displayed, and negative values are taken down */
}
a:active {background-position:0 -132px;
/* Define the normal state of the link, at which point the bottom portion is displayed and negative values are taken down/
}
DIV+CSS Study Notes