Simple CSS tricks to achieve the Logo animation effect (very much like the effect of the navigation bar often used, but there are differences)

Source: Internet
Author: User

Before many people said to realize like Ali Hundred Show logo as the animation effect, in order to meet the needs of users, here is a simple demonstration. Things are relatively simple, so don't think you can't handle them.

Here is the case code for the demo

1 <style>2 . Imlogo{3 Display:Block;4 width:160px;5 Height:80px;6 background:#FF5E52 URL (logo2.png) center 22px no-repeat;  /*The general wording is the horizontal position, then the vertical position*/7 -webkit-transition:background-position linear. 2s;  /*straight, linear. */8 -moz-transition:background-position linear. 2s;9 transition:background-position linear. 2s;    Ten } One . Imlogo:hover{ A background-position:center-48px;     - } - </style> the  - <aclass= "Imlogo"href="#"></a>

Display effect:

After moving in:

In fact, you just need to change the image address, logo area size (160px and 80px) background map coordinates (22PX and -48px), you can achieve your own animation, if you are very lazy, then do a 119*100px logo, A picture like the following (the background is made transparent, PNG format, you can implement the code to change color).

In the theme of the Style.css finally add, and then make a original logo height twice times the diagram first replaced, and then change the 48 for your position can be, do not calculate the words directly to try a few more can know which is appropriate.

Simple CSS tricks to achieve the Logo animation effect (very much like the effect of the navigation bar often used, but there are differences)

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.