I am developing a series of pages from which I do not control their layout, and this creates some unique problems. The styles are based on the design layout I received, and therefore there are instances - for example, h2 elements that should look different than other specific h2 elements in order for the design to be respected.
I'm currently trying to apply some style that should affect most h2 elements, but not the h2 elements that appear in a div with the class "block". What would the CSS selector look like in this case? I went to a limb and tried it, but I was right in believing that this is not entirely correct.
h2:not(.block h2) {
~styling for main h2 elements~
}
.block h2 {
~separate styling for h2 elements within .block div~
}
Can someone shed some light? Thank!
source
share