The mouse goes through the icon switching effect, and the Mouse icon Switching Effect

Source: Internet
Author: User

The mouse goes through the icon switching effect, and the Mouse icon Switching Effect

We are no stranger to the magical effect of switching the mouse over the icon. How can we implement it with code?

Html:

<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <Style type = "text/css">
{
Display: block;
Width: 67px;
Height: 32px;
Background: url (images/ico.png) no-repeat;
} A: hover
{
Background-position: bottom;
} </Style>
</Head> <body> <a href = "#"> </a> </body>

Image:

Note:

1. hyperlink <a> is an in-Row Element and cannot directly define the width and height. Therefore, you need to use display: block to convert it into a block element.

2. The background image is aligned with the upper left corner of the box by default. When you move the mouse, you need to align the background image with the bottom of the box, that is, use background-position: bottom ;.

Effect:

When the mouse goes through the front mouse

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.