how to center text vertically in html using css only
i have a very simple html. due to some limitations, i cannot modify the html content. I want to center the text vertically only using css.
<html> <head>...</head> <body> <div>Ops, the webpage is currently not available</div> </body> </html>
Note that the size of the html can be variable.
In additional, if the text cannot be displayed in one line, it should be broken into multiple lines.
Is it possible?
I think vertical-align only works for content which is in a table. For your simple page you could put the content in a table instead of a div to avoid this problem.
There are some workarounds, see http://phrogz.net/css/vertical-align/index.html