div>p selects all <p> elements where the parent is a <div> element and div p selects all <p> elements inside <div> elements. This is what W3schools says but i dont know what is the difference. If an element is inside another one is child and the other is parent. I dont see the differences.
div>p selects all <p> elements where the parent is a <div> element and div
Share
Example:
div > pwon’t select that paragraph, butdiv pwill. In other words, the first selector is parent-child, while the second is ancestor-descendant.