Tuesday, January 26, 2021

Creating Google logo by using just HTML and CSS.

 

Step 1:

Create a div element and give it id as google..

  <div id="google"></div>


Step 2 :

Style the div element by selecting its id ..code is given below:

 #google{
            positionrelative;
            border-top100px solid #ea4335;
            border-right100px solid #4285f4;
            border-bottom100px solid #34a853;
            border-left100px solid #fbbc05;
            border-radius50%;
            background-color#fff;
            width300px;
            height300px;
            padding0;
            margin10vh auto 0;
        }


Step 3 :

Use before pseudo selector on the #google element

  #google::before{
            content"";
            z-index100;
            positionabsolute;
            top50%;
            right-95px;
            transformtranslateY(-50%);
            width245px;
            height100px;
            background-color#4285f4;
        }


Step 4 :

Use after pseudo selector on the #google element


        #google::after{
            content"";
            z-index101;
            positionabsolute;
            border-top200px solid transparent;
            border-right200px solid white;
            top-100px;
            right-100px;
            width0;
            height0;
            
        }


No comments:

Post a Comment