Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

bottom property

Sets or retrieves the bottom position of the object in relation to the bottom of the next positioned object in the document hierarchy.

CSS 2.1, Section 9.3.2

Syntax

bottom: length | percentage | auto

Property values

auto

Default. Default position, according to the regular HTML layout of the page.

length

Floating-point number, followed by an absolute units designator (cm, mm, in, pt, or pc) or a relative units designator (em, ex, or px). For more information about the supported length units, see CSS Values and Units Reference.

percentage

Integer, followed by a percent sign (%). The value is a percentage of the height of the parent object.

CSS information

Applies ToAll elements
Mediavisual
Inheritedno
Initial Valueauto

Standards information

Remarks

The bottom attribute should be used only when the position attribute is set; otherwise, the value of the bottom attribute is ignored.

Because the value of the bottom property is a string, the property cannot be used in script to calculate the position of the object in the document; instead, the pixelBottom property or the posBottom property should be used.

For more information about how to access the dimension and location of objects on the page through the Dynamic HTML (DHTML) object model, see Measuring Element Dimension and Location with CSSOM in Internet Explorer 9.

Examples

The following example uses the bottom property to change the position of the red div. In the example below, there are four div elements with absolute positioning. The red div is positioned at 10% from the bottom.

Code example: http://samples.msdn.microsoft.com/workshop/samples/css/positioning/positioning.html



#red {			
   height: 150px;
   width: 150px;
   background-color: #F25022;
   position: absolute;
   bottom: 10%;
}	


See also

CSSStyleDeclaration
currentStyle
defaults
runtimeStyle
style
Reference
pixelTop
posTop

 

 

Show:
© 2014 Microsoft