How do I vertically align text within a td and a span?
-
29-06-2021 - |
Вопрос
Here is what I have, the only CSS is styling for my tags, so there is no relevant CSS effecting this.
<tr>
<td colspan="2" valign="top"><span style="font-size:20px; color:#ed8f49">Fall Classes with</span><img src="REDACTED.png" height="90" width="482"></td>
</tr>
When I have only the TD things work fine, but as soon as I put that text in a span or try to make it h1 it aligns to the bottom, even if I add alignment attributes to the span as well.
Решение
You need align="top"
or style="vertical-align:top
on your image :)
Другие советы
Try:
<td colspan="2" style="vertical-align: top;">
The attribute valign
is deprecated and should not be used.
Не связан с StackOverflow