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 -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -