Forum Moderators: not2easy

Message Too Old, No Replies

text stick to the top of the TD

         

hbmehta

9:32 pm on Jan 28, 2010 (gmt 0)

10+ Year Member




Hi, I am using Table, Tr, Td to create menu bar. everything works as expected except text in Td.
I have given position absolute, top, left px to Table and TD and relative to TR. I tried everything that can be done...vertical-align, valign, padding, margin etc but test sticks to the top of the TD. I want it to be vertically center aligned.

Code -


.menuBarItems {
width: 132px;
height: 35px;
text-align: center;
overflow: hidden;
position: absolute;
background-image: url(../images/Menubar-plus-11pixels.jpg);
background-repeat: repeat;
vertical-align: text-middle;
}
.firstLevelMenuRowClass {
height: 35px;
background-image: url(../images/Menubar-plus-11pixels.jpg);
background-repeat: repeat;
position: relative;
top: 0px;
left: 0px;
z-index: 10;
}
.menuFonts {
font-family: HELVETICA;
color: ffffff;
position: absolute;
top: 64px;
left: 0px;
z-index: 4;
}

<table width="100%" cellspacing="0px" cellpadding="0px" class="menuFonts">
<tr id="firstLevelMenuRow" class="firstLevelMenuRowClass">
<td id="cell1" style="left: 136px; top: 64px;" class="menuBarItems">Company Sales</td>
</tr>


Company Sales

No idea whats going on. Thanks in advance.

limbo

10:23 am on Feb 9, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi hbmehta

Try validating that HTML/CSS first. There's a couple of things in the snippet you posted that might be causing issues elsewhere. Once that's validated, and if the problems persist, come back and we'll take another look.

hbmehta

3:53 pm on Feb 9, 2010 (gmt 0)

10+ Year Member



Hi Limbo, Thanks for your reply. I already figured out what was the problem after I posted that comment.