Understanding the rules of constructing selectors that consist of more than one selector can be quite challenging.
It seems that sometimes it is possible to create such selectors, which may contain instances of other selectors made up of multiple parts. However, there are situations where this is not feasible. Take a look at this HTML example:
<!DOCTYPE html>
<html lang="en">
...
For some reason, the styling of divs works as expected based on specific rules. But, things get confusing when paragraphs are styled using certain rules even if they are not children of divs. This raises questions about how selectors are actually combined in CSS.
Perhaps defining explicit styles for paragraphs will help clarify things, but it's puzzling why certain rules apply differently than expected, especially when combining different types of selectors. The complexities of selector construction in CSS can sometimes lead to unexpected outcomes.
If you find yourself struggling with selector combinations, it might be worth revisiting the fundamental rules and principles governing CSS selectors made up of more than one part. Clarifying these concepts could bring greater clarity to your styling efforts.