Positionsart: position
Beispiel für position:absolute
Beispiel für position:relative
Beispiel für position:fixed
Bestimmt die Art, wie die Positionsangaben verwendet werden.
<style type="text/css"><!--
.examplediv
{
background-color:#efefef;
border-style:solid #000000 1px;
}
#divid
{
position:absolute;
left:450px; top:350px; width:300px; height:150px;
}
// --></style>
<body>
<div id="divid" class="examplediv">
...
</div>
Initialwert: | static |
Vererbbar: | Nein |
Anwendbar auf: | Alle Elemente |
Medium: | Visual |
Werte: |
- absolute
- Absolute Positionierung durch die Angaben
left, top,
right, bottom.
Absolut positionierte Elemente sind außerhalb des normalen Textfluß, sie liegen über
den anderen Elementen und beeinflussen somit nicht ihr Layout. Die absolute Position
wird relativ zu den Rändern des Eltern-Elements
berechnet, wenn dieses ebenfalls positioniert ist, oder wenn es der Seiteninhalt
(<body>) ist. Da sich der Seiteninhalt scrollen lässt, werden absolut
positionierte Elemente mitgescrollt.
- relative
- Relative Positionierung vom normalem Fluß.
Die normale Position ist wie bei static im normalem Textfluß.
Die Positionierungsangaben
left, top,
right, bottom verschieben das Element
aus dieser Position. Die nachfolgenden Elemente verhalten sich so, als wäre das Element
nicht verschoben
- fixed
- Wie absolute, jedoch bleibt das Element beim Scrollen stehen.
- static
- Positionierung im Textfluss.
Die Angaben left, top,
right, bottom sind unwirksam.
- Inherit
|
Wert |
 |
 |
 |
 |
 |
 |
 |
5 |
5.5 |
6 |
MAC 5+ |
5 |
6 |
7+ |
4 |
6 |
7+ |
1+ |
0.8+ |
1.0+ |
3.3+ |
absolute, relative, static |
j |
j |
j |
j |
j |
j |
j |
j |
j |
j |
j |
j |
j |
j |
fixed |
n |
n |
n |
j |
j |
j |
j |
n |
j |
j |
j |
j |
j |
j |