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?
in bootstrap 3 here are the classes to change the text color:
<p class="text-muted">...</p> //grey
<p class="text-primary">...</p> //light blue
<p class="text-success">...</p> //green
<p class="text-info">...</p> //blue
<p class="text-warning">...</p> //orangish,yellow
<p class="text-danger">...</p> //red
Documentation under Helper classes - Contextual colors.
There are helper classes in bootstrap 3 with contextual colors please use these classes in html attributes.
<p class="text-muted">...</p>
<p class="text-primary">...</p>
<p class="text-success">...</p>
<p class="text-info">...</p>
<p class="text-warning">...</p>
<p class="text-danger">...</p>
Reference: http://getbootstrap.com/css/#type
In addition to @Connor Leech's answer.
If you want to create a new custom typography type of your own, define the following in your css file.
.text-foo {
.text-emphasis-variant(#FFFFFF);
}
The mixin text-emphasis-variant
is defined in Bootstrap's mixins.less
file.
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.
You can also apply the default 'text' classes available from bootstrap itself
<h1 class='text-info'>Hey... I'm blue</h1>
http://twitter.github.io/bootstrap/base-css.html
you could use the font style Like:
<font color="white"><h1>Header Content</h1></font>