<p>Is there a tool that will find for me all the css classes that I am referencing in my HTML that don't actually exist?</p>

<p>ie. if I have &lt;ul class="topnav" /&gt; in my HTML and the topnav class doesn't exist in any of the referenced CSS files.</p>

<p>This is similar to <a href="https://stackoverflow.com/questions/33242/how-can-i-find-unused-images-and-css-styles-in-a-website">SO#33242</a>, which asks how to find unused CSS styles. This isn't a duplicate, as that question asks which CSS classes are not used.  This is the opposite problem.</p>

[{'answer_id': 79306, 'author': 'Milan Babuškov', 'author_id': 14690, 'author_profile': 'https://Stackoverflow.com/users/14690', 'pm_score': 1, 'selected': False, 'text': '<p>Error Console in Firefox. Although, it gives <strong>all</strong> CSS errors, so you have to read through it.</p>\n'}, {'answer_id': 79321, 'author': 'Swati', 'author_id': 12682, 'author_profile': 'https://Stackoverflow.com/users/12682', 'pm_score': 0, 'selected': False, 'text': '<p><a href="http://www.jetbrains.com/idea/features/html_css_editor.html" rel="nofollow noreferrer" title="IntelliJ Idea">IntelliJ Idea</a> tool does that as well. </p>\n'}, {'answer_id': 79433, 'author': 'mislav', 'author_id': 11687, 'author_profile': 'https://Stackoverflow.com/users/11687', 'pm_score': 3, 'selected': True, 'text': '<p>You can put this JavaScript in the page that can perform this task for you:</p>\n\n<pre><code>function forItems(a, f) {\n  for (var i = 0; i &lt; a.length; i++) f(a.item(i))\n}\n\nfunction classExists(className) {\n  var pattern = new RegExp(\'\\\\.\' + className + \'\\\\b\'), found = false\n\n  try {\n    forItems(document.styleSheets, function(ss) {\n      // decompose only screen stylesheets\n      if (!ss.media.length || /\\b(all|screen)\\b/.test(ss.media.mediaText))\n        forItems(ss.cssRules, function(r) {\n          // ignore rules other than style rules\n          if (r.type == CSSRule.STYLE_RULE &amp;&amp; r.selectorText.match(pattern)) {\n            found = true\n            throw "found"\n          }\n        })\n    })\n  } catch(e) {}\n\n\n  return found\n}\n</code></pre>\n'}, {'answer_id': 97654, 'author': 'Buzz', 'author_id': 13113, 'author_profile': 'https://Stackoverflow.com/users/13113', 'pm_score': 0, 'selected': False, 'text': '<p><a href="http://www.sitepoint.com/dustmeselectors/" rel="nofollow noreferrer">This Firefox extension</a> is does exactly what you want.</p>\n\n<p>It locates all unused selectors. </p>\n'}]
['https://Stackoverflow.com/questions/79258', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4640/']