繁体   English   中英

html + css 格式化字体

[英]html + css formatting font

我一直在使用<font>标签来设置字体样式,但是在通过 html 验证器运行页面后,我发现这些标签现在没有使用。

所以我的问题是在不使用字体标签的情况下实现以下目标的最佳方法是什么。

echo  "<b><font size ='2'> ".$horse."</b></font> <font size ='2'>".horselastrace($horse, $db)."</font><b><font color='red'>".horsebeatenfav($horse, $db)."</font></b>"
<span style='font-size:12px;'>insert code</span>

如果您使用 php 编写,请尝试:

echo '<span class="small">'.$horse.horselastrace($horse, $db).'</span><span class="red">'.horsebeatenfav($horse, $db).'</span>';

带有样式表(css 文件):

span.small {
      font-size: 12px;
      font-weight: bold;
}
span.red {
    font-weight: bold;
    color: red;
}

此外,不推荐使用<b>标签,您的 HTML 标签不应按以下顺序排列:

<div><p>code</div></p>

但像这样封闭:

<div><p>code</p></div>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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