Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

the css selector :empty for tr td is not working

Tags:

css

I have checked some article here, but I just got no answer in my case. I need the empty content td show no bg-color, and I have css an :empty, but it does not work.

sample code here: http://codepen.io/bard/pen/aDKiv

Thanks experts.

like image 407
bard Avatar asked Sep 18 '13 11:09

bard


2 Answers

It is not working as your TD has a blank space in itself. Do not let that '&nbsp' come in TD and it will work as '&nbsp' does not fulfill the condition of :empty

And change the following

#wp-calendar tr td:empty {
    background:none !important;
}
like image 160
Ganesh Pandhere Avatar answered Sep 23 '22 03:09

Ganesh Pandhere


you can achieve it as follows:

#wp-calendar tr td.pad:not(:empty) {
    border:none !important;
    background-color: rgba(255,255,255,0.04);
}

if you want to apply some style in case of empty. try following:

#wp-calendar tr td.pad:(:empty) {
   /* some style */
}
like image 31
Ahsan Shah Avatar answered Sep 21 '22 03:09

Ahsan Shah