Search code examples
csshtml-tablevertical-alignmentvalign

td valign="top" not working - CSS overriding somewhere


ANSWERED!

I have some css overriding my tables but I don't know how to find it. I simply need images in my table to be at the top of the table. I use the code:

<td valign="top"><img src="../../../images/site/orangeBanner.png" alt="" width="259" height="62" class="imagePic"/></td>

But it does not work and produces this image of the orange bar in the middle. It should be at the top at the same height as "INSPIRE".

enter image description here

Here is the link to my full code: FULL CODE

Can anyone see why my valign="top" is not working? Is there anything to override the css?


Solution

  • Your td originally has vertical-align: middle specified inside the CSS. You can override it by using style="vertical-align: top;" inline inside the <td> tag containing your image. This should work perfectly:

    <td valign="top" style="vertical-align: top;"><img src="../../../images/site/orangeBanner.png" alt="" width="259" height="62" class="imagePic"/></td>