CSS3 dynamic prompt effect when the mouse moves into the picture
php中世界最好的语言
Release: 2018-03-21 09:54:34
Original
2959 people have browsed it
This time I will bring you the dynamic prompt effect of CSS3 when the mouse moves into the picture. What are theprecautionsto achieve the dynamic prompt effect of CSS3 when the mouse moves into the picture. The following is a practical case, let's take a look.
This is my first time trying to write a blog. I hope you can correct me if I have any mistakes or mistakes. Today I mainly write about some usage of transform, an important property of CSS3. These examples are from previous MOOCs. I typed it myself after taking a course from a certain teacher online.
1. Introduction
1. What is transform?
The meaning of transform is: change, deform...; transform
2. What are the common attributes of transform?
The properties of transform include: translate()/rotate() / skew() / scale() /, and they are divided into x and y respectively, such as: rotatex() and rotatey(), And so on.
transform:translate()
Meaning: change, displacement; for example, 20 pixels to the right and 50 pixels to the top (negative values to the left and down). Examples are as follows
Meaning: Ratio 1.8 means enlarging at a ratio of 1.8. If it is an integer multiple, such as enlarging 3 times, it must be written as 3.0 The example is as follows
demo01 Description: After the mouse is moved in, the picture moves to the left and the content enters in sequence
Steps:
1. Write the html code and set the initial style of the content and pictures through css (the text content is on the picture);
2. Transform the description content The attribute is shifted to the left until it is no longer visible (transform:translate(-600px,0););
3. Next, set the style when the mouse moves in (:hover). Also use transform to move the content to the left. The distance is 0 (transform:translate(0,0)). The transition-delay attribute is used here mainly to delay the three contents for different times to form the effect of entering in sequence.
demo02 Description: After the mouse is moved in, the picture becomes blurred and the rectangle rotates from outside the picture into the specified position in the picture. The text flies over from the right and gradually displays
Steps:
1. Write the html code and set the initial style of the content and image through css (the rectangular text is on the image);
2. Move the rectangle to the top through the transform attribute Until you can't see it and set the rotation angle to 0 transform: translate(0,-400px) rotate(0deg);
3. Next, set the style displacement when the mouse moves in (:hover) to 0 and set it to 0. Rotate 360 degrees transform: translate(0,0) rotate(360deg);
demo04 Description: After the mouse is moved in, the rectangle and text are displayed and reduced, and the picture is also reduced
Steps:
1. Write the html code and set it through css Good content and initial style of pictures
2. Magnify the content by 1.2 times. This is to create a shrinking effect when the magnification becomes 1 after the mouse is moved in. The transparency of the content is set to 0;
The above is the detailed content of CSS3 dynamic prompt effect when the mouse moves into the picture. For more information, please follow other related articles on the PHP Chinese website!
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn