Jump to content

bootstrap css overrides defined styles


funbinod

Recommended Posts

(sorry if I choose wrong place to post this. I got confused whether to post it on javascript or css)

 

I am trying to learn bootstrap. but simply after including bootstrap.css, it overrides most of the styles I defined on the page. like buttons, tables, etc. can anyone guide me how to handle this?

Link to comment
Share on other sites

Like it was mentioned, your stylesheet should go after bootstrap's stylesheet.

 

After that, check the DOM tab in the developer tools of you browser to see which selectors are being used to style an element. To override an existing selector your selector needs to be more specific. How do you make a selector more specific? Here are a few ways:

  1. Add an ID to the selector. IDs have the highest precedence.
  2. Have more components than the selector you're trying to override. For example: span.class is more specific than .class and ul.menu li a is more specific than .menu a

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...