I will try to give my explanation of it. In a nutshell - something like this
/* Hiding Page Title on Homepage */
#doc-page-575 doc-layout-title-bar {
display: none !important;
}
does not work because the ID #doc-page-575 appears in the CSS after doc-layout-title-bar - it isn’t a child of the page number ID in terms of how it is written and loaded to the page and so the code “doesn’t find it”.
The :has selector allows us to sort of back up to something that does have the page ID as a child and then also has the target as a separate child. So in other words we find a parent that our page ID and the target have in common and build the selector with that.
I will try to give my explanation of it. In a nutshell - something like this
/* Hiding Page Title on Homepage */
#doc-page-575 doc-layout-title-bar {
display: none !important;
}
does not work because the ID #doc-page-575 appears in the CSS after doc-layout-title-bar - it isn’t a child of the page number ID in terms of how it is written and loaded to the page and so the code “doesn’t find it”.
The :has selector allows us to sort of back up to something that does have the page ID as a child and then also has the target as a separate child. So in other words we find a parent that our page ID and the target have in common and build the selector with that.
That would be my understanding of it.
That’s excellent Greg and makes complete sense - I could see that the parent element wasn’t quite right while inspecting/testing in dev mode. Thanks again!