1

I found many techniques about how to vertically center some text within a div, but all those techniques depend on fixed dimensions. Is it possible to achieve when the div's height and width vary as they're expressed in percentage?

Guido
  • 926
  • 2
  • 10
  • 19
drake035
  • 3,955
  • 41
  • 119
  • 229
  • 2
    You need to google some more. For example http://css-tricks.com/centering-in-the-unknown/ – Marnix van Valen Aug 24 '14 at 18:07
  • `as they're expressed in percentage` It means they are already **specified explicitly**. Hence there shouldn't be any issue with those approaches if you replace those fixed length by percentage units (Just be aware of what the percentage value refers to) – Hashem Qolami Aug 24 '14 at 18:24
  • possible duplicate of [What's The Best Way of Centering a Div Vertically with CSS](http://stackoverflow.com/questions/396145/whats-the-best-way-of-centering-a-div-vertically-with-css) – Salman A Aug 24 '14 at 18:52

1 Answers1

0

You may try to add the line display: table-cell; to your css for that div

JSFiddle Demo

Rahul Tripathi
  • 168,305
  • 31
  • 280
  • 331