Are CSS selectors without properties of any effect? -


i got maintenance job , there huge css file, in found lot of things following:

.xxxx {} 

that is, selector absolutely nothing in it. think useless, there many of them start doubt myself. right can removed safely? or doing , should keep them?

i'd it's worst design in history (or stronger contender title...) could used.

see below:

document.stylesheets[0].cssrules[0].style.setproperty('color', 'red');
.randomclass {}
<div class="randomclass">no styling?</div>

you can acces, process, , modify stylesheets. if selector empty of styles, can modified using code.

so, it's safe remove, if want 100% certain, either leave there, or go through possible code branches.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -