Reputation: 5528
I’m looking for a way to style everything except some. If I wanted to select everything within a table except a particular td how to achieve this using css only ?
Upvotes: 0
Views: 691
Reputation: 3915
There's also a :not() pseudo class in CSS3 which does similar thing.Here is the working demo too http://jsfiddle.net/raynesax/Ps48t/1/
Upvotes: 1
Reputation: 92803
there are several way to do that. For example
give common property
table tr td{background:red}
for particular element
table tr td:nth-child(3){background:green};
there other :last-child, :first-child
Upvotes: 1
Reputation: 32602
If your particular td has a class name then:
table td { background: red; }
table td.particular { background: white; } /* inherit, auto, etc */
Upvotes: 4