center text div vertically css





I have a div tag which contains text, and I want to align the contents of this div vertically center. Here is my div styleUsing CSS we simulate table display behavior, since tables support vertical alignment: div display: table width: 250px height: 100px text-align: center Vertically Center Multi-Lined Text. By Chris Coyier On May 13, 2009. speech bubble, typography, vertical-align.Well, the regular way of vertically centring in css has been documented by Duan Janovsk. It needs an extra div for its IE solution, but it doesnt require any expressions, only regular Vertical Align Text with CSS trick. Horizontal centering with css is rather easy. When the element to be centered is an inline element we use text-align center on its parent. To place a div (or any block level element) of unknown size containing text, in center of its parent vertically, the following approach can be used.Example div having one line text.