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

swift - Button on Table View Cell connected to local function -

dns - Dokku server hosts two sites with TLD's, both domains are landing on only one app -

c# - ajax - How to receive data both html and json from server? -