Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Center Vertically in CSS? Re: Center Vertically in CSS?

#71015
tafkanator
Participant

It would be nice if you could provide a code too. Then its much easyer to help You. But you could try one trick that has helped me a lot. Try this rule: line-height: ???px
??? = the height of your grey div.
For example:

Code:

vertycally center

Code:
#mydiv{
height:100px;
line-height:100px;
overflow:hidden /*This is here just in case you have more than one row of text*/
}

works only if you have one row of text.

But without the code i cannot help much more.