Zitat:
Zitat von cloned
Abgesehen vom root Element gibt immer ein Eltern Element.
|
Dazu ein Beispiel. Nicht wirklich durchdacht, aber dennoch lustig.
viewport → html (root) → body → …
HTML-Code:
<!DOCTYPE html>
<meta charset="utf-8">
<title>root parent (html) :: viewport</title>
<style>
html { position: relative; border: 2em solid #aaa; background-color: #ccc; }
body { margin: 3em 2em; background-color: #eee; }
p { top: 0; left: 0; padding: 0; }
p:first-child { position: fixed; }
p:last-child { position: absolute; }
</style>
<p>Position Fixed</p>
<p>Position Static</p>
<p>Position Absolute</p>