With Twitter Bootstrap, how can I customize the h1 text color of one page and leave the other pages to be default?

前端 未结 8 1617
小蘑菇
小蘑菇 2021-01-31 18:00

On my index page, I want the h1 text color to be white and comes with shadow, but I don\'t want to change the default behavior the h1 on other pages. How can I achieve this?

8条回答
  •  闹比i
    闹比i (楼主)
    2021-01-31 18:41

    The best way to solve this problem would be by starting with customizing Bootstrap using their customization tools.

    http://getbootstrap.com/customize/

    Go down to @headings-color and change it from "inherit" to something that you would like your headers to be across the site (if you like the default just change it to #333).

    Note that this will keep all your headings the same color, as you requested.

    Now in order to accomplish what you want that after you make this change you can now overwrite them specifically in your own CSS to apply your own color to them. The "inherit" keyword I always have found to be a pain in frameworks.

提交回复
热议问题