为什么我的jQuery:Not()选择器不能在CSS中工作
<div id="sectors"> <h1>Sectors</h1> <div id="s7-1103" class="alpha"></div> <div id="s8-1104" class="alpha"></div> <div id="s1-7605" class="beta"></div> <div id="s0-7479"></div> <div id="s2-6528" class="gamma"></div> <div id="s0-4444"></div></div>
#sectors { width: 584px; background-color: #ffd; margin: 1.5em; border: 4px dashed #000; padding: 16px; overflow: auto;}#sectors > h1 { font-size: 2em; font-weight: bold; text-align: center;}#sectors > div { float: left; position: relative; width: 180px; height: 240px; margin: 16px 0 0 16px; border-style: solid; border-width: 2px;}#sectors > div::after { display: block; position: absolute; width: 100%; bottom: 0; font-weight: bold; text-align: center; text-transform: capitalize; background-color: rgba(255, 255, 255, 0.8);
unassigned
alpha
, beta
gamma
:
$('#sectors > div:not(.alpha, .beta, .gamma)').addClass('unassigned');
#sectors > div.unassigned { color: #808080; background-color: #e9e9e9; opacity: 0.5;}#sectors > div.unassigned::after { content: attr(id) ' - Unassigned';}#sectors > div.unassigned:hover { opacity: 1.0;}
:not()
:not()
:not()
.unassigned
#sectors > div:not(.alpha, .beta, .gamma) { color: #808080; background-color: #e9e9e9; opacity: 0.5;}#sectors > div:not(.alpha, .beta, .gamma)::after { content: attr(id) ' - Unassigned';}#sectors > div:not(.alpha, .beta, .gamma):hover { opacity: 1.0;}
:not()
千巷猫影