Search code examples
twitter-bootstraptextcolor

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


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?


Solution

  • You can add your own id or class to the body tag of your index page to target all elements on that page with a custom style like so:

    <body id="index">
       <h1>...</h1>
    </body>
    

    Then you can target the elements you wish to modify with your class or id like so:

    #index h1 {
       color:red;
    }