html - 有没有一种方法可以让我知道哪些文件受到使用 Sublime Text 2 的 CSS 规则的影响?

标签 html css sublimetext2

如上所述,我希望能够找到元素中受 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 of main.

关于html - 有没有一种方法可以让我知道哪些文件受到使用 Sublime Text 2 的 CSS 规则的影响?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14074674/

相关文章:

css - 在 x 轴上重复三种颜色的 CSS 背景?

python - api : how to get selected text from object sublime. 选择

html - 将 h2 容器定位在父容器内

html - 如何使我的 React 应用程序标题响应?

javascript - 在不降低图片质量的情况下减小javascript中的图像大小并下载图像

c++ - Sublime Text 启动单独的命令窗口(C/C++)

css - 如何为我的 CSS 使用另一个括号/制表符策略?

html - 下拉菜单显示不正确

jquery - 如何将同级组件添加到 jquery 日期选择器

css - 有多少类会被认为是 'poor practice'