HTML CSS examples for CSS Selector:elements inside elements
The 'element element' selector selects elements inside elements.
Select every <p> element that is inside <div> elements:
<!DOCTYPE html> <html> <head> <style> div p { background-color: yellow; } </style><!-- ww w . j a v a2 s .co m--> </head> <body> <h1>Welcome to My Homepage</h1> <div> <h2>this is a test</h2> <p>this is a paragraph.</p> </div> <p>I <b>like</b> css.</p> </body> </html>