Get the App
SLTechnology News&Howtos  ›  Development  › 

How to set the magnification effect of picture by CSS

Shulou Source: shulou.com Published: 2022-06-01 12:53:58 10月05日 Update

This article mainly introduces CSS how to set the picture magnification effect, the article introduces in great detail, has a certain reference value, interested friends must read it!

Idea: the animation effect of picture magnification is still realized by transition and transform. First set the initial position of div, transition time, etc., and then set properties such as translate,scale,rotate.

Translate: represents horizontal and vertical movement

Scale: represents horizontal and vertical scaling at the same time

Rotate: represents the angle of rotation.

Specific code:

CSS image enlargement-(yisu.com) div {width: 200px; height: 100px; transition: all .3s;} div:hover {transform: translate (100px, 100px) scale (2) rotate (0deg);}

w3cschool

The above is all the contents of the article "how to set the picture magnification effect in CSS". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Pictures effects representatives content level articles code value location interests animation at the same time guys partners attributes ideas time more knowledge industry Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Apple vpn MariaDB Shulou Tech Info