How to Apply global font to whole HTML document

后端 未结 6 989
悲&欢浪女
悲&欢浪女 2020-12-07 08:57

I have a HTML page which includes some text and formatting. I want to make it have the same font-family and the same text-size ignoring all inner formatting of text.

6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-07 09:38

    Use the following css:

    * {
        font: Verdana, Arial, 'sans-serif' !important;/* <-- fonts */
    }
    

    The *-selector means any/all elements, but will obviously be on the bottom of the food chain when it comes to overriding more specific selectors.

    Note that the !important-flag will render the font-style for * to be absolute, even if other selectors have been used to set the text (for example, the body or maybe a p).

提交回复
热议问题