How to detect CSS inheritance source?

旧街凉风 提交于 2019-12-03 11:13:10

问题


So far, I can only tell if a property is inherited or not, but I need to know the source of inheritance, (for ex, which CSS file caused the final value ?) is this possible ?

Is there a handy tool for this ?

EDIT

Here is what I get in chrome Computed Style (show inheritance) See the direction property, there is no info about its inheritance source


回答1:


You can do this job very easily by using Firebug in Firefox or Chrome's Developer Tools.

Chrome Developer Tools

Like image shows below.

For more information check Chrome Developer Tools: Element Styles Here

In Firebug

Like image shows below.

For more information check CSS Development Here

You can install Fire Bug From Here

Update 1:

You can find it by just clicking Show Inherited check box on Chrome's computed style panel likes below.

Update 2:

In Firebug, you just click inherited element what I showed below image.Then It will guide you to the relevant Inherited element's location.

P.S. - Same can do by using chrome Tool.




回答2:


The cascading nature of CSS makes the Styles browser in the Elements Tab very useful, you can see the individual styles and where they come from, you can also see the final set of styles after it is computed and applied to the element.

EDIT

You can refer a property and its source from computed style panel

Reference

  • Chrome Dev Tools.


来源:https://stackoverflow.com/questions/14065400/how-to-detect-css-inheritance-source

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!