无法为给定的以下代码更改标记的字体大小
<td valign="top" width="620"><strong><a href="images/pub/pub1.pdf" target="_self">Factsheet of the OSCE Border Management Staff College</a></strong><br /><br /><strong><span style="font-size: 11px; color: #aaaaaa;">14 June 2013</span></strong>已尝试:
<td valign="top" width="620"><strong><a style="font-size:14px;" href="images/pub/pub1.pdf" target="_self">Factsheet of the OSCE Border Management Staff College</a></strong><br /><br /><strong><span style="font-size: 11px; color: #aaaaaa;">14 June 2013</span></strong>什么都没有改变;
<td valign="top" width="620"><strong><a class="pub" href="images/pub/pub1.pdf" target="_self">Factsheet of the OSCE Border Management Staff College</a></strong><br /><br /><strong><span style="font-size: 11px; color: #aaaaaa;">14 June 2013</span></strong>
a.pub
{
font-size: 14px;
}没有变化;
<td class="pub" valign="top" width="620"><strong><a href="images/pub/pub1.pdf" target="_self">Factsheet of the OSCE Border Management Staff College</a></strong><br /><br /><strong><span style="font-size: 11px; color: #aaaaaa;">14 June 2013</span></strong>
td.pub
{
font-size: 14px;
}没有效果;它使用的是来自style.css文件的标签的字体,我想只为这个标签改变字体大小。你知道我做错了什么吗?
发布于 2013-06-15 16:04:15
奇怪的是它不会改变,因为inline styles是最具体的,如果样式表声明了!important,它就不会覆盖ride,试试这个,看看
<span style="font-size: 11px !important; color: #aaaaaa;">Hello</span>发布于 2013-06-15 16:05:36
在样式中使用此属性
font-size: 11px !important;//your font sizeby !重要的它会覆盖你的css
发布于 2013-06-15 22:25:15
您应该分析您的style.css文件,可能会使用您最喜欢的浏览器中的开发人员工具,以查看哪个规则以覆盖style属性中的字体大小的方式设置元素的字体大小。显然,它必须使用!important说明符,这通常表明样式中的逻辑和结构很差。
首先,修改style.css文件,使其不使用!important。如果失败,请在style属性中的规则中添加!important。但您的目标应该是减少!important的使用,而不是增加它。
https://stackoverflow.com/questions/17121453
复制相似问题