Is there a difference between .class element and element.class in a CSS selector?
I had always been shown element.class but j
"element.class" selects elements that have the given class.
".class element" selects all elements that are children of anything with the given class.
Example:
...
div.foo would select the div, while .foo p would select the child paragraph. It should be noted that without specifying direct child via the ">" selector, this will traverse the entire document tree when looking for children.