what is the difference between :empty and :blank (CSS Selectors Level 4 draft) ?
Other than the fact that blank only works in Firefox as of now.
div div{
width:100px;
height:100px;
display:inline-block;
margin:5px;
}
div.emptyCell:empty{
background:#009688;
}
div.blankCell:blank{
background:#3F51B5;
}
<div><div class="emptyCell"><!-- nothing but a comment--></div>
<div class="emptyCell"></div>
<div class="emptyCell"><!-- nothing but a comment--></div>
<div class="emptyCell"></div>
</div>
<div>
<div class="blankCell"></div>
<div class="blankCell"><!-- nothing but a comment--></div>
<div class="blankCell"></div>
<div class="blankCell"><!-- nothing but a comment--></div>
</div>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…