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>Google pay logo using HTML and CSS</title> </head> <body> <div class="google-pay"> <div class="red"></div> <div class="yellow"></div> <div class="green"></div> <div class="blue"></div> </div> </body> </html>
CSS
body { min-height: 100vh; display: grid; place-items: center; } .google-pay { display: grid; place-items: center; position: relative; margin-top: 7rem; } .google-pay > * { position: absolute; } .blue { width: 140px; height: 80px; background: #297aec; transform: rotate(-60deg) translate(-35px, -70px); border-radius: 50px 25px 25px 0; } .green { width: 170px; height: 80px; background: #2da94f; transform: scalex(-1) rotate(60deg) translate(-20px, -30px); border-radius: 50px 25px 25px 0; } .yellow { background: yellow; width: 170px; height: 80px; background: #297aec; transform: rotate(-60deg) translate(-20px, 10px); border-radius: 0 25px 25px 40px; position: relative; } .yellow::before { position: absolute; content: ""; inset: 0; background: #fdbd00; border-radius: 50px 25px 25px 50px; z-index: 1; } .red { background: #2da94f; width: 140px; height: 80px; transform: rotate(-60deg) translate(25%, 49px); border-radius: 0 0 50px 25px; } .red::before { position: absolute; content: ""; inset: 0; background: #ea4335; border-radius: 0 50px 50px 25px; z-index: 1; }
JS
Google pay logo using HTML and CSS