Quote:
Originally Posted by Julius Caesar
Thanks Rubén. It looks far more complicated than I thought...
|
Not at all
You only have to:
1. To define a <div> to be displayed as a table (with the property
display: table;). Also give it the height that you wish (i.e,
height: 200px;).
2. To define inside the previous div, a another <div> or <p> to be displayed as a table-cell (with the property
display: table-cell;). Also give it the property
vertical-align: middle.
That's all. After that, all what you write inside the second <div> or <p> will be vertical aligned regarding the div defined in 1.
Read the following article (Method 1):
Vertical Centering with CSS
Regards
Rubén