본문 바로가기
HTML CSS

KokoaTalk Clone Coding: transformations

by jane.dev 2021. 5. 6.
반응형

search on the google 'transform mdn'

 

<head>

    <style>

        img {

            border: 5px solid black;

            border-radius: 45px;

            transform: translateX(30px) translateY(30px);

        }

    </style>

</head>

<body>

    <img src="img/logo.jpg" />

</body>

logo

 

add

<body>

    <span>Java Script</span>
</body>

inspection

Image is on top of text. Transformation doesn't modify box elements. It doesn't apply margin, padding.

The span thinks that image still is where it should be. So the span doesn't aware that the image has been moved.

 

<style>

    img {

        border: 5px solid black;

        border-radius: 45px;

        transform: translateX(100px) translateY(100px);

        transition: transform 3s ease-in-out;

    }

    img:hover {

        transform: rotate(360deg);

    }

</style>

transform

 

<style>

    img {

        border: 5px solid black;

        border-radius: 45px;

        transition: transform 3s ease-in-out;

    }

    img:hover {

        transform: rotateZ(360deg) scale(0.3);

    }

</style>

transform

 

<style>

    img {

        border: 5px solid black;

        border-radius: 45px;

        transition: transform 2s ease-in-out;

    }

    img:hover {

        transform: matrix(6, 5, 4, 3, 2, 1);

    }

</style>

transform