Open In App

How to Create Google logo with HTML and CSS ?

The Google logo is a globally recognized symbol of the tech giant, known for its colourful and playful design. It consists of the word "Google" in a unique font, with each letter in a different colour, representing the company's diverse range of products and services. In this article, we will design the Google logo with the help of HTML and CSS.

Approach to create Google Logo:

Example: Implementation to design the logo of Google.

<!DOCTYPE html>
<html lang="en">

<head>
    <title>Google Logo</title>
    <meta charset="UTF-8">
    <meta name="viewport" 
          content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
</head>

<body>
    <div id="container">
        <div id="logo">
            <div class="g-line"></div>
            <span class="red"></span>
            <span class="yellow"></span>
            <span class="green"></span>
            <span class="blue"></span>
        </div>
    </div>
</body>

</html>

@import url('https://fonts.googleapis.com/css?family=Roboto');

html,
body {
    background: #f1f1f1;
    margin: 0;
    min-height: 100%;
    font-family: 'Roboto', sans-serif;
}

#container {
    position: relative;
    margin: 50px auto 0;
    width: 1000px;
    height: 300px;
}

#logo {
    position: relative;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    margin: 0 auto;
    overflow: hidden;
    border: 25px solid #f1f1f1;
    box-shadow: 0 0px 4px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.24);
}

#logo::after {
    content: '';
    display: block;
    width: 60%;
    height: 60%;
    border-radius: 50%;
    background: #f1f1f1;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
    z-index: 4;
}

#logo::before {
    content: '';
    display: block;
    width: 35%;
    height: 32%;
    background: #f1f1f1;
    position: absolute;
    right: 0;
    bottom: 50%;
    transform: rotateZ(45deg);
    -webkit-transform: rotateZ(45deg);
    z-index: 10;
}

.g-line,
.yellow,
.green,
.blue,
.red {
    position: absolute;
    z-index: 2;
}

.g-line {
    width: 50%;
    height: 20%;
    background: #0091ea;
    right: 0;
    margin: auto;
    border-bottom-right-radius: 4px 20px;
    top: 0;
    bottom: 0;
    z-index: 15;
}

.yellow {
    width: 40%;
    height: 40%;
    left: -15%;
    bottom: 32%;
    background: #ffc107;
    transform: rotateZ(-48deg);
    -webkit-transform: rotateZ(-48deg);
    z-index: 3;
}

.green {
    width: 100%;
    height: 50%;
    bottom: 0;
    border-radius: 0 0 100% 100%;
    background: #4caf50;
}

.blue {
    width: 35%;
    height: 32%;
    background: #0091ea;
    right: 0;
    top: 50%;
    transform: rotateZ(45deg);
    -webkit-transform: rotateZ(45deg);
}

.red {
    width: 81%;
    height: 50%;
    top: 0;
    background: #f44336;
}

Output:

How to Create Google logo with HTML and CSS ?


Article Tags :