funbinod Posted February 6, 2015 Share Posted February 6, 2015 (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 More sharing options...
tejasamrute Posted February 7, 2015 Share Posted February 7, 2015 Make sure you attach your custom css file after bootstrap css or else you will have to use !important after every style 1 Link to comment Share on other sites More sharing options...
Ingolme Posted February 7, 2015 Share Posted February 7, 2015 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: Add an ID to the selector. IDs have the highest precedence. 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 1 Link to comment Share on other sites More sharing options...
funbinod Posted February 7, 2015 Author Share Posted February 7, 2015 thank u both for the good guidance.... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now