简体   繁体   中英

How do I vertically align text within a td and a span?

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.

Try:

<td colspan="2" style="vertical-align: top;">

The attribute valign is deprecated and should not be used.

你的图像需要align="top"style="vertical-align:top :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM