Saturday, 5 December 2020

                                     CSS Transitions

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS Transitions </title>
</head>
<style>
    div {
        marginauto;
        margin-bottom10px;
        width100px;
        height100px;
        background-colorcornflowerblue;
        transition:height 4s, width 2s, background-color 3s,font-size 2s ,transform 2s;

    }
    #normal:hover{
        width300px;
        colorwhite;
        font-size2em;
        background-colorturquoise;
        transition-timing-functionease/*ease - specifies a transition effect with a slow start, then fast, then end slowly (this is default) */
    }
    #several:hover{
        width300px;
        height300px;
        colorwhite;
        font-size2em;
        background-colorturquoise;
        transition-timing-functionlinear/*linear - specifies a transition effect with the same speed from start to end*/
    }
    #delay:hover{
        width300px;
        height300px;
        colorwhite;
        font-size2em;
        background-colorturquoise;
        transition-timing-functionease-in/*linear - specifies a transition effect with the same speed from start to end*/
        transition-delay1s;
    }
    #transform:hover{
        width300px;
        transformskewX(-70deg);
        height250px;
        colorwhite;
        /* font-size: 2em; */
        background-colorturquoise;
        transition-timing-functionease-in/*linear - specifies a transition effect with the same speed from start to end*/
        transition-delay1s;
    }
    #shorthand:hover{
        width300px;
        transformscale(2,2);
        height250px;
        colorwhite;
        /* font-size: 2em; */
        background-colorturquoise;
        transition-timing-functionease-in/*linear - specifies a transition effect with the same speed from start to end*/
        transition-delay1s;
    }
</style>
<body>
    <div id="normal">First example just width transition    </div>
    <div id="several">Change Several Property both width and height</div>
    <div id="delay">Delay the Transition Effect</div>
    <div id="transform">Transition + Transformation</div>
    <div id="shorthand">transition is the shorthand for the 4 transition properties : <br>1.transition property :width, height etc. <br> 2.transition duration in seconds<br> 3.transition-timing-function eg:ease, linear etc<br> 4.transition-delay in seconds</div>
</body>
</html>

 

No comments:

Post a Comment

Get Phone Number Details Using Python

 Get Phone Number Details Using Python Import Python module PHONENUMBERS using command " pip install phonenumbers" in you CLI Then...