Home > Web Front-end > CSS Tutorial > How to rotate the background in css

How to rotate the background in css

coldplay.xixi
Release: 2023-01-05 16:12:49
Original
8725 people have browsed it

How to rotate the background in css: first define the style for the content, and define the width and height of the li where the image is located; then set the transition effect for the image, using the transition attribute for the transition; then set the deformation for it through rotate; finally Just run the program.

How to rotate the background in css

The operating environment of this tutorial: windows7 system, css3 version, DELL G3 computer.

How to rotate the background with css:

First prepare an HTML document with two pictures in the document, and then rotate the two pictures.

How to rotate the background in css

Then define some styles for the content in HTML, as shown in the figure below, mainly the title and ul styles.

How to rotate the background in css

#Next, define the width and height of the li where the picture is located, as shown in the figure below.

How to rotate the background in css

#Then set the transition effect for the image and use the transition attribute for the transition, as shown in the figure below.

How to rotate the background in css

When the mouse is hovering over the image, set the transformation to it through rotate, as shown in the figure below. Positive numbers represent clockwise, and negative numbers represent counterclockwise. .

How to rotate the background in css

Finally run the program and you will see the effect as shown in the picture below. Place the mouse on the picture and it will rotate clockwise or counterclockwise.

How to rotate the background in css

Related tutorial recommendations: CSS video tutorial

The above is the detailed content of How to rotate the background in css. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
source:php.cn
Statement of this 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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template