修复 h1 字体大小 !important 样式大小
Fixing h1 font-size !important style size
我在 h1
标签中有 font-size
,在许多页面中有不同的大小,但我想将它们全部标准化为 25px
,但是当我尝试添加一个style
在页面的 head
部分它根本没有反映更改。我怎样才能用需要的覆盖原来的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>
路径有问题,如果您的html所有标题都相同,那么您可以在css
中使用这种类型的路径
建议css
h1 > span > a { font-size: 25px!important }
它正在为您的 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>
希望这个回答对您有所帮助。
我在 h1
标签中有 font-size
,在许多页面中有不同的大小,但我想将它们全部标准化为 25px
,但是当我尝试添加一个style
在页面的 head
部分它根本没有反映更改。我怎样才能用需要的覆盖原来的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>
路径有问题,如果您的html所有标题都相同,那么您可以在css
中使用这种类型的路径建议css
h1 > span > a { font-size: 25px!important }
它正在为您的 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>
希望这个回答对您有所帮助。