HomeReferencesCSS Properties

CSS Property: top

For absolutely positioned boxes, specifies how far from the top of the containing box (which is the first containing relatively positioned box or the page itself) the box should be.

For relatively positioned boxes, specifies how far from the top a box should be shifted.

HTML Dog, The Book HTML Dog book cover

HTML Dog is hosted by Titan Internet

Possible Values

  • [percentage]
  • [length]
  • inherit
  • auto (default)

Example


#forsale {
	position: absolute;
	top: 25%;
}