简体   繁体   中英

Force the whole website use one font -family

I would like to apply

font-family: Helvetica to all element in the site.

So I write

body, html {
    font-family: Helvetica !important;
}

in the CSS file, the problem is , the font-family is still override by other inner CSS. How to force the whole site use one font family?

Thanks a lot for helping.

* {
    font-family: Helvetica !important;
}

Is it being overriden by other css style rules with !important ? If so, there is nothing to do as more specific selectors win over more general ones.

You could use the inspector in chrome, or other browser's equivalent to see how the cascade styles on your particular element unfolds. Your inner CSS could have also defined the !important flag, which overrides you definition on body.

If you post your entire html and CSS people might be able to help more easily.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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