Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the document</title> <style> p:only-child { background: #1c87c9; } </style> </head> <body> <h2>:only-child selector example</h2> <div> <p>Lorem ipsum is simply dumnmy text.</p> </div> <div> <p>Lorem ipsum is simply dummy text.</p> <p>Lorem ipsum is simply dummy text.</p> </div> </body> </html>