funbinod 3 Posted February 6, 2015 Report 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? Quote Link to post Share on other sites
tejasamrute 6 Posted February 7, 2015 Report 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 Quote Link to post Share on other sites
Ingolme 1,032 Posted February 7, 2015 Report 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 Quote Link to post Share on other sites
funbinod 3 Posted February 7, 2015 Author Report Share Posted February 7, 2015 thank u both for the good guidance.... Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.