查看demo style p:last-child{ background-color: #ccc; } div:not(p){ color: blue; } div p:not(:last-child){ border: 1px solid #ccc; } /style div class="wra