如何在不使用`!important`的情况下强制应用CSS? [英] How to force applying css without using `!important`?
本文介绍了如何在不使用`!important`的情况下强制应用CSS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
主题的默认字体不支持我的语言,因此我通过在style.css上添加该字体来将其替换为支持的字体.
The default font of my theme doesn’t support my language, so I replace it with a supported one by adding this on the style.css
@font-face { font-family: 'LibreBaskerville';
src: url('https://xn--qucu-hr5aza.cc/wp-content/themes/the-thinker-lite-child/font/LibreBaskervilleF-Regular.ttf');
url('https://xn--qucu-hr5aza.cc/wp-content/themes/the-thinker-lite-child/font/LibreBaskervilleF-Regular.woff') format('woff');
}
但是,一个插件仍使用默认字体:
However, one plugin still uses the default font:
我问过作者,他们说除了使用
* { font-family: "LibreBaskerville" !important;}
或复制主题的作用以覆盖它:
or copy what my theme is doing to override it:
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {font-family: "LibreBaskerville";}
我发现这两种解决方案都不是问题的根源.有更好的方法吗?
I find both solutions don't get to the root of the problem. Is there a better way to do so?
查看全文