0

In our application we use Bootstrap and there are multiple CSS files that are used.

Recently, I had a issue where there was a border created around a input box. The border for the CSS for input types were over-ridden in a particular CSS file.

I tried to use the Chrome DEV tools to identify which CSS file that input box was picking (for color) but for some reason it was not identifying the correct CSS files. For borders, shape and size it was mentioning it was inheriting from the parent but it never mentioning which is the parent CSS file.

Is there a better tool which correctly points the CSS that the component is using?

1
  • I find Chrome Dev tools sufficient. Just make sure when you inspect an element, you go to the side panel to view all the CSS applied to it (it shows both the applied and the overridden ones, including which files they came from) Commented Jun 7, 2014 at 19:56

2 Answers 2

1

Is there a better tool which correctly points the css that the component is using?

Firebug is great & very well developed. But works only in FireFox, which should not be a big deal for your basic CSS debugging purposes. In general there is no one good tool to debug things like this. You will always be jumping around from tool to tool to get things right. It’s just the nature of front-end web development.

But in general, might not have to even touch the parent CSS to deal with this issue. Just target the element in CSS—if it is not already being targeted—and use !important to force your new setting to override others from parent styles.

However, for balance, an "!important" declaration (the delimiter token "!" and keyword "important" follow the declaration) takes precedence over a normal declaration. Both author and user style sheets may contain "!important" declarations, and user "!important" rules override author "!important" rules. This CSS feature improves accessibility of documents by giving users with special requirements (large fonts, color combinations, etc.) control over presentation.

Here is an example code that would force outline: none to all input elements:

input {
  outline: none; !important
}

You can even add border: 0px solid; to the mix as well:

input {
  border: 0px solid; !important
  outline: none; !important
}
Sign up to request clarification or add additional context in comments.

1 Comment

Not only Firebug, but I also personally find Firefox devtools to be much easier and more intuitive to use than Chrome devtools.
1

I tried to use the Chrome DEV tools to identify which CSS file that input box was picking (for color) but for some reason it was not identifying the correct CSS files. For borders, shape and size it was mentioning it was inheriting from the parent but it never mentioning which is the parent CSS file.

In general Chrome Developer Tools shows exactly which .css-files are used and from which element the styles are inherited.

Can you maybe provide an example with your exact problem?

enter image description here

3 Comments

Sorry I can't make comments yet. :/
It is an answer actually. Demonstrating why chrome dev tools shows exactly what the OP is looking for and asking if there is a reason why this is not enough to meet the needs
@morkro: I had a issue last week that got fixed with help of a senior dev..I get this often and I will post the moment I find one

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.