如上所述,我希望能够找到元素中受 css 规则影响的所有文件。 例如,我输入“#header .container li”,我得到了应用该规则的所有文件。
为了更清楚一点,假设我有一个包含这些 html 文件的元素:
File 1:
---------------------
<html>
<div id="header">
<div class="container">
<ul>
<li>Something</li>
<li>Something</li>
</ul>
</div>
</div>
</html>
---------------------
File 2:
---------------------
<html>
<div id="header2">
<div class="container">
<ul>
<li>Something</li>
<li>Something</li>
</ul>
</div>
</div>
</html>
---------------------
File 3:
---------------------
<html>
<div id="header">
<div class="container">
<ul>
<li class="nomatter">Something</li>
<li>Something</li>
</ul>
</div>
</div>
</html>
---------------------
如果我输入“#header .container li”(CSS 规则),我希望得到文件 1 和文件 3,因为它们受到我输入的 css 规则的影响。
最佳答案
使用插件/包 Element Finder (需要 nodejs)。
复制自an introduction post其作者:
Element Finder is a tool for web developers to find which HTML files contain elements matching a specific CSS selector. You might be new on a project, returning to a project that you haven’t worked on for a while, or maybe a CSS selector is just unclear and you’re not sure exactly which pages it will effect. Just copy a CSS selector into Element Finder and you will quickly see all of the HTML elements in your project which match that selector. For example if you search for
div.main
, it will show you all the DIV elements with a classname ofmain
.
关于html - 有没有一种方法可以让我知道哪些文件受到使用 Sublime Text 2 的 CSS 规则的影响?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14074674/