Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

How to overide h3 text color in bootstrap?

Hi i'm sure its really simple but I have some elements I would like in my website different colours than the standard bootstrap theme and I am having difficulty changing them. I'm sure its really easy but everything I've tried from the internet doesn't seem to be working. To be clear its headings and paragraph elements i'm looking to change.

2 Answers

Hi Murray!

You should include these styles in an external css file made by you such as "main.css" and then link this stylesheet after you have linked bototstrap in your .html files.

Let me know if you get it working!

-Luke

Thanks a lot Luke, much appreciated

Jeff Lemay
Jeff Lemay
14,268 Points
  1. In the < head > of your html doc, you can move the link to your custom stylesheet below the bootstrap stylesheet so that your custom styles will override the bootstrap styles.
  2. You can add !important tags your properties to force them to override
h3 {
   color:#00FF00 !important;
}
Jeff Lemay
Jeff Lemay
14,268 Points

FYI, important tags make it easy to override styles but it is strongly recommend that these are avoided. Things can get out of hand quickly and make your life more difficult in the long run.

Am I better deciding on colour schemes beforehand and downloading a customised version of bootstrap?

Jeff Lemay
Jeff Lemay
14,268 Points

That's a good idea, you're color scheme may change as you continue building your site though. Even if you go this route, you should definitely have a custom stylesheet that is linked after your bootstrap.css file.

Thanks a lot Jeff your comments are very appreciated.