position

Browser Internet Explorer Netscape Opera Safari Firefox
Version 5.5 6.0 7.0 8.0 8.0 9.0 7.0 8.0 9.2 9.5 1.3 2.0 3.1 1.5 2.0 3.0
Supported Partially Partially Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes

Short information
CSS CSS2
Default value static
Inherited Yes
Applied To all elements except generable elements
HTML analog No
Reference to specification http://www.w3.org/TR/CSS21/visuren.html#propdef-position

Description
This parameter determines a way of element positioning concerning either a browser window or other objects on a web page.

Syntax

position: absolute | fixed | relative | static

Arguments
absolute
It specifies that the element is absolutely positioned. In this case it does not exist in a usual stream of the document like other elements which are displayed on the web page as if there is no absolutely positioned object. Element position is specified by attributes left, top, right and bottom concerning a border of a browser window.
fixed
This value is similar to the argument absolute, but unlike it becomes attached to specified parameters left, top, right and bottom to a point on the screen. It does not change the position even at paging of the web page. At all Browsers Netscape, Mozilla and Firefox do not display a scrolling strip if element position is specified as fixed and it is not located entirely in a browser window. Though in browser Opera scrolling strips are shown, but they do not influence in any way an element position. Internet Explorer 6 and more low versions do not support the given argument.
relative
Element position is determined rather its initial place. Addition of the attributes left, top, right and bottom changes an element position and shifts it in this or that side from an initial arrangement depending on the applied parameter.
static
Elements are displayed as usually. Use of parameters left, top, right and bottom does not lead to any results.

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
  <title>position</title>
 </head>
 <body>
 
  <div style="font-family: Times, serif; font-size: 200%">
  T<span style="position: relative; top: 10px">E</span>X 
  and L<span style="position: relative; top: -5px; font-size: 80%">A</span>T<span 
  style="position: relative; top: 10px">E</span>X
  </div>
 
 </body>
</html>

The result of this example is shown on the figure 1


Object model

[window.]document.getElementById("elementID").style.position

Remark
Browser Internet Explorer 7 supports the value "position: fixed" only in "strict" mode ().
Cloud Backup
Backup Server
Application Virtualization Client
Data Center Virtualization