The child selector matches only elements that are first generation from the parent selector.
Text within a p directly below a div has a blue background
In this case, the text does not have a blue background even though it is within a p that is within a div since p is not directly below div. Being within details and summary means that p is not a child but but perhas a child of a child or further down the line.
Text not within a div does not have a blue background.
Style
div > p { background-color: Lightblue; }