text-align = center 不工作
text-align = center not working
我正在练习 html 电子邮件并尝试将文本居中。但它不工作。我也怀疑这不起作用,因为我在字体标签内使用样式标签。我已经在 validator.w3.org 中测试了我的代码并通过了。这段代码有什么问题吗?请帮助我将文本居中对齐。
Doctype is : <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<tr>
<td>
<font style="font-family: verdana; font-size:10px; font-weight: bold; text-align: right;"><i>
"We are such stuff as dream are made on, and our little life is rounded with a sleep" William Shakespeare</i>
</font>
</td>
</tr>
这是您更正后的代码:
<table width="100%">
<tr>
<td style="text-align: right;">
<font style="font-family: verdana; font-size:10px; font-weight: bold;"><i>
"We are such stuff as dream are made on, and our little life is rounded with a sleep" William Shakespeare</i>
</font>
</td>
</tr>
</table>
使用 align="left" 属性而不是 text-align
我正在练习 html 电子邮件并尝试将文本居中。但它不工作。我也怀疑这不起作用,因为我在字体标签内使用样式标签。我已经在 validator.w3.org 中测试了我的代码并通过了。这段代码有什么问题吗?请帮助我将文本居中对齐。
Doctype is : <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<tr>
<td>
<font style="font-family: verdana; font-size:10px; font-weight: bold; text-align: right;"><i>
"We are such stuff as dream are made on, and our little life is rounded with a sleep" William Shakespeare</i>
</font>
</td>
</tr>
这是您更正后的代码:
<table width="100%">
<tr>
<td style="text-align: right;">
<font style="font-family: verdana; font-size:10px; font-weight: bold;"><i>
"We are such stuff as dream are made on, and our little life is rounded with a sleep" William Shakespeare</i>
</font>
</td>
</tr>
</table>
使用 align="left" 属性而不是 text-align