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

nicholas maddren
nicholas maddren
12,793 Points

Apply Bootstrap CSS Customizations

Hello community, I am a little confused with Bootstrap at the moment.

So I have added changes to the Bootstrap CSS by creating a folder called style.css. I have changed some of Bootstraps default CSS, here is an example:

.navbar-nav > li:last-child{
    border-right: 1px solid #475d88;
}

That uses Bootstrap classes to change the nav.

If I now use these classes to create another navbar on the page I will be left with the changes from my other navbar. How can I make multiple changes without affecting other elements?

Thanks

1 Answer

An easy workaround to this problem, and others like it, is to create a class just for the element you want to select.

For example is this is the navigation at the top of page creating a .navtop class for specific stylings to that element.