HTML
CSS
JS
Result
HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>WhatsApp logo using HTML and CSS</title> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css"> </head> <body> <div class="whatsapp-white-part whatsapp-common"> <div class="whatsapp-common"> <i class="fas fa-phone"></i> </div> </div> </body> </html>
CSS
body { min-height: 100vh; display: grid; place-items: center; background: #89eb9d; } .whatsapp-common { width: 70px; height: 70px; border-radius: 35px; background: #3ac371; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); } .whatsapp-white-part { width: 80px; height: 80px; border-radius: 40px; background-color: #fff; box-shadow: 2px 2px 3px 2px rgba(0, 0, 0, 0.3); } .whatsapp-white-part::before { content: ""; top: 65px; left: -15px; border-width: 20px; border-style: solid; border-color: transparent #fff transparent transparent; position: absolute; transform: rotate(-50deg) rotateX(-55deg); } .whatsapp-white-part::after { content: ""; top: 63px; left: -4px; border-width: 15px; border-style: solid; border-color: transparent #3ac371 transparent transparent; position: absolute; transform: rotate(-51deg) rotateX(-50deg); } .fas { left: 17px; top: 18px; position: absolute; font-size: 35px; color: #fff; transform: rotate(90deg); }
JS
WhatsApp logo using HTML and CSS