Jump to content

Recommended Posts

Hello,

I have this code :

/* 
tables css
*/
table.menu_table td a{display: block  ; vertical-align: middle;} 
table.menu_table td a:link, table.menu_table td a:visited {font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
text-decoration:none;
	color : black;} 
table.menu_table td a:hover, table.menu_table td a:active {background-image: url('../images_all/row.gif'); color: #FFFFFF;  text-decoration: none; height: 20px; vertical-align: middle;} 

 

and at the html file :

<table class="menu_table" width="502"  height="19" border="0" cellspacing="0" cellpadding="0" ">

 

When the mouse is over it change the backround but it doesnt center the text vertical, it shows it at the top of the filed!

Any sugestion will be very valuable.

Thank you

Link to comment
https://forums.phpfreaks.com/topic/128703-place-the-text-in-the-vertical-middle/
Share on other sites

Simply add a top-margin of about 50% to the text, i asume you enclosed the text in paragraphs. Then it would be something like:

td p {
margin: 50% auto;
}

 

 

vertical-align:middle; on inline elements dosn't work as you expect, but it should on td elements. So try something like below instead:

 

/*

tables css

*/

td { vertical-align: middle; }

table.menu_table td a{display: block;}

table.menu_table td a:link, table.menu_table td a:visited {font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 10px;

text-decoration:none;

color : black;}

table.menu_table td a:hover, table.menu_table td a:active {background-image: url('../images_all/row.gif'); color: #FFFFFF;  text-decoration: none; height: 20px;}

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.