Help - Search - Members - Calendar
Full Version: vertical align
Pixel2Life Forum > Help Section > HTML, XHTML, CSS and General Web Design
Chris.
I'm trying to align sometime vertically in a 25px high block of CSS. I tried using the "vertical-align: middle" attribute, but that didn't work, I looked online for a little bit, and found this,

CODE
DIV.container {
    min-height: 10em;
    display: table-cell;
    vertical-align: middle }


but that didn't work either. I want my text to be centered vertically in my block, but I can't, for the life of me, figure out how to do it.. Please help
Chris.
The vertical align attribute didn't work either... I mean, I got it centered vertically using padding, but there has to be a better way to do it...
harry819
use this code
CODE
<STYLE type="text/css">
#container { width: 100%; height: 100%; display: table; }
#position { display: table-cell; vertical-align: middle; width: 100%; text-align: center; }
</STYLE>
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.