1. Home
  2. Computing & Technology
  3. Web Design / HTML

top

By Jennifer Kyrnin, About.com

top Description:

The top property defines how far the top of the element is offset from the top of the container element.

top in CSS Versions:

top Syntax:

top: <length> | <percentage> | auto | inherit

  • <length>
    A precise unit of meaurement.
  • <percentage>
    A percentage of the height of the containing block.
  • auto
    Determined by widths and heights of the elements.
  • inherit
    The element should have the same top value as the parent element.

top Initial Value:

auto

top Applies To:

Positioned elements.

top Inheritance:

This property is not inherited.

top Browser Support:

top Media Type:

  • Visual

top Examples:

Standard top property

<p style="top : 5px;">
This paragraph should display 5 pixels from the top of the container element.
</p>

top Special Notes:

  • Negative units are permitted.

More top Information

Return to the Style Library

Explore Web Design / HTML

More from About.com

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. CSS
  5. Style Properties
  6. CSS Style Property: top

©2008 About.com, a part of The New York Times Company.

All rights reserved.