Hide all div.class children of TD, then show first div.class child

Dolfnegeple

New Member
The following should work in theory, to the best of my knowledge, but is not:HTML:\[code\]<td class="views-field-field-entry-images-fid"><a href="http://stackoverflow.com/questions/4628929/#"><img src="http://stackoverflow.com/questions/4628929/x.jpg" /></a><small class="attachments">Files<div class="file-listing">Content A + B</div></small><small class="attachments">Files<div class="file-listing">Content B</div></small><small class="links">Links<div class="file-listing">Content C</div></small></td>\[/code\]Style:\[code\]td small.attachments { display: none; }td small.attachments:first-child { display: inline-block !important; }\[/code\]The result is, any time a small.attachments element has no small.attachment siblings, it is shown fine, with the first-child rule applied and overriding the display:none rule.However, when there are two small.attachments elements in a TD, one after the other (in example above), BOTH are hidden, and the first-child rule has no effect.What's going on?PS: I've tested in Safari and Firefox.
 
Top