html - 修复 h1 字体大小 !important 样式大小

标签 html css styles font-size

我在 h1 标签中有 font-size,在许多页面中有不同的大小,但我想将它们全部标准化为 25px,但是当我尝试在页面的 head 部分添加 style 时,它根本没有反射(reflect)出变化。我怎样才能用需要的覆盖原来的font-size

h1 {font-size: 25px!important}
<h1 align="center">
<span style="font-size: 10pt" lang="ar-sa">
<a style="text-decoration: none" href="example.come">
<font color="#008000">Title here</font></a></span></h1>

最佳答案

它为您的 h1 采用字体大小,但因为您有 span 的内联样式。因此,您不仅需要覆盖 font-size 到您的 h1,还需要覆盖 span

h1 span {font-size: 25px!important}
<h1 align="center">
<span style="font-size: 10pt" lang="ar-sa">
<a style="text-decoration: none" href="example.come">
<font color="#008000">Title here</font></a></span></h1>

希望这个回答对你有帮助。

关于html - 修复 h1 字体大小 !important 样式大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55331720/

相关文章:

html - 如何将父 div 放置在其子元素之上?

jquery - 使用动画增加背景图像大小

Android list 无法识别 styles.xml 中列出的系统主题

html - 将一个 div 放在 float div 的左下角

javascript - jquery 包含不适用于\(反斜杠)的选择器

javascript - 为什么我的动态更改链接不起作用? (Javascript)

html - java applet 上面的 DIV

html - 表格单元格中的列表彼此重叠

php - 如何在主页上的帖子下方显示日期?

html - CSS 外部字体在 Div 中不起作用