<!doctype html> <html> <head> <title>Opacity</title> <link href="/assets/reset.css" rel="stylesheet"> <link href="setup.css" rel="stylesheet"> <link href="style.css" rel="stylesheet"> </head> <body> <section> <p>This is some text in the first element.</p> </section> <section> <p>And some more in the second element.</p> </section> <section> <p>Then a third one, too.</p> </section> </body> </html>
/* Same as before. */ body { font-family: sans-serif; padding: 20px; } section { background-color: deepskyblue; border-top: solid black 4px; padding: 10px; } section:not(:first-child) { margin-top: 20px; }
section:nth-child(2) { opacity: 0%; } section:nth-child(3) { opacity: 50%; }