<!doctype html> <html> <head> <title>Border radius</title> <link href="/assets/reset.css" rel="stylesheet"> <link href="setup.css" rel="stylesheet"> <link href="style.css" rel="stylesheet"> </head> <body> <section> <p>Unlike margin and padding, borders can be rounded.</p> </section> <section> <p>This is often used in combination with a background.</p> </section> <section> <p>It can also only adjust specific corners!</p> </section> </body> </html>
/* Same as before. */ body { font-family: sans-serif; padding: 20px; } section { padding: 20px; } /* Every one but the first one. */ section:not(:first-child) { margin-top: 20px; }
section:nth-child(1) { border-radius: 50%; /* Relative to size. */ border: 2px dotted deepskyblue; } section:nth-child(2) { background-color: gold; /* No borders! */ border-radius: 10px; /* Absolute amount. */ } section:nth-child(3) { border: 4px solid tomato; border-bottom-right-radius: 25px; border-top-left-radius: 25px; }