CSS to make the mouse move up icon rotation

Source: Internet
Author: User
This time for everyone to bring CSS to make the mouse up icon rotation, to achieve the mouse move icon rotation of the note what, the following is the actual case, together to see.

The mouse up icon rotation effect is often used in enterprise projects, especially the top navigation bar, such as:

The next step is to use CSS to implement the mouse up icon rotation effect.


<!      DOCTYPE html> 


Here is a box, put a picture in the box, in order to be able to see more clearly, here put a larger picture. The effect now is that when you move the mouse over the. Box box, the icon IMG will do a 180-degree rotation.

The key to the style is the IMG and. Box:hover img Settings, first we need to set the Transition property to IMG, where the properties specify how and when the animation lasts. Then give the. box settings when the mouse moves up: hover the action of IMG is rotated 180 degrees:


Transform:rotate (180DEG);


The settings below, such as-webkit-, are set primarily to be compatible with the browser of each vendor.

The resulting effect is as follows:

Believe that you have read the case of this article you have mastered the method, more exciting please pay attention to the PHP Chinese network other related articles!

Recommended reading:

Specific tips for using CSS margin

Refine the style of a radio box, check box

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.