English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

CSS Reference Manual

CSS @rules

Complete List of CSS Properties

CSS caption-side attribute usage and example

 caption-The side CSS attribute sets the vertical position of the table title box. To horizontally align the title text within the title box, please usetext-alignAttribute.

The following table provides usage instructions and version history of this attribute, as well as its syntax in JavaScript scripts.

Default value:top
Applies to:Table
Element
Inheritance:Yes
Animatable:No View Animation properties.
Version:CSS 2,3
JavaScript syntax:object.style.captionSide="bottom"

caption-side attribute syntax

The syntax of this attribute is as follows:

caption-side: top | bottom | initial | inherit

The following examples demonstrate how to use caption-side attribute.

  caption {
   caption-side: bottom;
  }
Test and see‹/›

Attribute value

The following table describes the values of this attribute.

ValueDescription
topPlace the title box above the table box.
bottomPlace the title box below the table box.
initialSet this attribute to its default value.
inheritIf specified, the associated element adopts the caption of its parent element.-side attribute values.

Browser compatibility

caption-Browser compatibility of the side attribute, the numbers in the following table represent the minimum version number of the browsers that support this attribute; all mainstream browsers support this attribute.

  • Firefox 1+

  • Google Chrome1+

  • Internet Explorer 8+

  • Apple Safari 1+

  • Opera 4+

Warning: Internet Explorer 7and earlier versions do not support this caption-side attribute. IE8Only in<!DOCTYPE>Supports only when a valid value is specified.

Further reading

See tutorial:CSS Tables.

Related attributes: text-align