View Single Post
Old 09-08-2013, 10:19 AM   #6
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,539
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by Julius Caesar View Post
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
RbnJrg is offline   Reply With Quote