View Full Version : HTML/CSS - vertical aligning a title.

Dec 17th, 2009, 12:05 AM
I'm trying to have the title of my div to be dead centre vertically. e.g..

<div id="header">Title</div>

Title shows at the bottom of the div, how can i have it centered?

Dec 17th, 2009, 12:40 AM
Hello forcerhpool,
The quick answer might be <div id="header"><h1>Title</h1></div> and #header h1 {line-height: 20px;}

Adjust that line-height as needed.