I need help selecting the following DIVs based on IDs but excluding some of the children DIVs in two different types of pages using a single style.css file:
PAGE1:
...
<div id="main">
<div id="post"> selected </div>
</div>
...
PAGE2:
...
<div id="main">
<div id="maincontent"> selected </div>
<div id="singlepost">
<div id="post"> selected </div>
<div id="comments"> excluded </div>
</div>
<div id="sidebar"> excluded </div>
</div>
....
I have tried with:
#main > :not(#sidebar), #singlepost > :not(#comments) a {
color: rgb(88, 134, 76) !important;
}
(!important overrides some inline CSS I cannot change)
The result is bad because Chrome only recognizes #main > :not(#sidebar),
and ignores #singlepost > :not(#comments) a
, thus turning all text into this color, not just links, and only excluding <div id="sidebar">
, not <div id="comments?>
.
I also tried:
#singlepost > :not(#comments) a {
color: rgb(88, 134, 76) !important;
}
#main > :not(#sidebar) a {
color: rgb(88, 134, 76) !important;
}
Now everything works as intended but <div id="comments">
is not excluded.
Please help, Dan