About
Explore
Events & Classes
Support Us
Join
Sign In
JUSTCodaborate
View Project Page
Run
Fullscreen
Shapes CSS
HTML
CSS
JS
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <h2>Regular Shapes with CSS</h2> <div class="square"></div> <br> <div class="circle"></div> <br> <div class="oval"></div> <br> <div class="rectangle"></div> <br> <div class="parallelogram"></div> <br> <div class="triangle-up"></div> <br> <div class="triangle-down"></div> <div class="triangle-left"></div> <div class="triangle-right"></div> <br> <div class="trapezoid"></div> </body> </html>
.square { height: 90px; width: 90px; background-color: purple; } .circle { height: 80px; width: 80px; background-color: red; border-radius: 50%; } .oval { height: 50px; width: 100px; background-color: green; border-radius: 50%; } .rectangle { height: 50px; width: 100px; background-color: blue; } .parallelogram { width: 100px; height: 50px; transform: skew(20deg); background: pink; } .triangle-up { width: 0; height: 0; border-left: 25px solid transparent; border-right: 25px solid transparent; border-bottom: 50px solid yellow; } .triangle-down { width: 0; height: 0; border-left: 25px solid transparent; border-right: 25px solid transparent; border-top: 50px solid dodgerblue; } .triangle-left { width: 0; height: 0; border-top: 25px solid transparent; border-right: 50px solid #cad; border-bottom: 25px solid transparent; } .triangle-right { width: 0; height: 0; border-top: 25px solid transparent; border-left: 50px solid #dee; border-bottom: 25px solid transparent; } .trapezoid { border-bottom: 50px solid #26a2ab; border-left: 25px solid transparent; border-right: 25px solid transparent; height: 0; width: 125px; }