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 Bootstrap Basics Getting to Know Bootstrap Getting to Know Bootstrap Review

Silly Bootstrap Question. . .

When doing the bootstrap basics course the instructor chooses colors from about 6 options for example: bg-success. This might be a dumb question but is bootstrap limited to these few color choices? or can I create buttons, forms etc with my own hex or RGB colors? If so can someone show me an example of how that would be formatted? thanks!

1 Answer

Steven Parker
Steven Parker
229,964 Points

Bootstrap defines several purpose classes, which have associated color ranges and are provided with several prefixes:

  • default (usually transparent)
  • primary (dark blue)
  • success (green)
  • info (light blue)
  • warning (yellow-orange)
  • danger (reddish)

You can use custom CSS to give things other colors; but consider carefully before doing this to a control, because one of the benefits of using Bootstrap at all is to give the user a familiar interface.

For more information (and a few other color classes) see the Bootstrap documentation.