Vés al contingut

Plantilla:Vertical center

De la Viquipèdia, l'enciclopèdia lliure

This simple template vertically centers text, including multi-line wrapped text. It is meant to be used inside a div that defines the region the text is to appear to be in the middle of. It takes three unnamed parameters:

  • The text to be vertically centered (the main parameter)
  • An addendum to the style applied to the inner div container (styled with "display:table-cell;").
  • An addendum to the outer div container (styled with "display:table;").

This does not work on IE7 or below. There is a supposed pre-IE8 compatible version in the file history but I don't know/can't test if it works on those browsers; certainly it doesn't work on Firefox. The version used here is based on http://css-tricks.com/vertically-center-multi-lined-text/ - (the other version that failed is based on section Update 3). Failure makes the text appear at the top of the cell, but it should still be readable. Knock on wood.