i have the cure to CSS vertical align.

Soldato
Joined
17 Oct 2002
Posts
7,408
Location
Stoke-on-Trent
ok add this to your stylesheet.

Code:
<style type="text/css">
<!--

#nav    {

    width: 200px;
    height: 25px;
}

.alignmiddle {

    vertical-align: middle;
}

-->
</style>

Next your going to need to make an invisible image. 1x1 pixel wide. Otherwise known as a "spacer gif".

Now basically you've got your Navigation or whatever with yout text in that you want to align to the middle.

Here's what i've done to get around it.

Code:
<div id="nav"><img src="spacer.gif" height="25" width="0" class="alignmiddle">Your Text Here Will Be Vertically Aligned</div>

For some reason when Browsers render CSS they refuse to vertically align text, but .. they WILL vertiically align images. So with our invisible spacer gif we set the height of the image to the same height of our #nav and then set the class of the image to .alignmiddle.

Now any text that is in the same div and class as that image will be vertically aligned :)

Paul ...
 
Back
Top Bottom