What to do with empty CSS rules?

After some review of the code, I removed the unnecessary properties that led to the empty rules.

So, I know something like this:

table.foo
{
}

table.foo td.bar
{
    padding: 5px;
}

Now, what would be the best way to act on this empty table rule? Delete it or leave it? Is there a requirement that a parent declaration can define child elements on them? It really works without it, simple, but maybe there are some validation considerations? Any input is appreciated.

+3
source share
6 answers

No, you do not need an empty rule.

Each rule in itself (that is, a rule selector provides a context), so you do not need an empty rule for table.footo have a rule for table.foo td.bar.

+10

! Lava Flow - -, , , , , . , !

+5

100% . , , .

CSS (, ) . , , , , , , , , , .

+1

, CSS, , , gotchas.

YUI CSS http://developer.yahoo.com/yui/grids/

Blueprint CSS http://www.blueprintcss.org/

, YUI .

, .

0

, . CSS. , .

0
0
source

Source: https://habr.com/ru/post/1711939/


All Articles