Possible Duplicate:
Complex CSS selector for parent of active child
I want to match a with id “breadCrumb” only if it has a child span id “userName”.
Match:
<div id="breadCrumb" class="nav">
<span id="userName">esac</span>
</div>
But not match:
<div id="breadCrumb" class="nav">
<span id="navtrail">...</span>
</div>
I want to set #breadCrumb { display: none; }, but I don’t want to hide it in the second case.
Firstly, these two elements aren’t on the same page are they? If so it’s invalid HTML as you can’t (shouldn’t) duplicate IDs.
You can’t do this with straight CSS. My advice would be to restate the problem:
or
then you can do things like:
or
Applying multiple class selectors (previous example) isn’t supported in IE6.