HTML elements are positioned static by default. Static positioned elements are not affected by the top, bottom, left, and right properties. An element with position: static; is not positioned in any special way; it is always positioned according to the normal flow of the page:
HTML file: | Displayed by browser: |
---|---|
<style>
div.static { position: static; border: 3px solid #8AC007; } div.static2 { position: static; border: 3px solid #8AC007; left: 100px; } </style> <body> <div>This &lt;div&gt; element has default static positioning.</div> <br /><div class="static">This &lt;div&gt; element has position: static;</div> <br /><div class="static2">This &lt;div&gt; element has position: static; as well, but does not respond to the left positioning at all. All static elements fall in the same order they are listed in the HTML document.</div> </body> |
This <div> element has default static positioning.
This <div> element has position: static;
This <div> element has position: static; as well, but does not respond to the left positioning at all. All static elements fall in the same order they are listed in the HTML document.
|