How can I change the font color of all texts of your website using Javascript?

前端 未结 3 1790
滥情空心
滥情空心 2021-01-29 10:37

I learned, that there are ways to change the color of single texts. However I\'d like to find out how to change the color of all texts of my website at one time.

I foun

3条回答
  •  心在旅途
    2021-01-29 11:12

    Use the CSS color property:

    CSS

    * {
       color:  [color-value];
    }
    

    This will change the font color of all elements using the universal (*) selector. If necessary, you may need to use the !important declaration (not recommended, but useful: see link) to override other styles.

    JavaScript

    document.body.style.color = [color-value];
    

提交回复
热议问题