CSS implementation: move the mouse over and change the link text instance code,

Source: Internet
Author: User

CSS implementation: move the mouse over and change the link text instance code,

CSS implementation: move the mouse over and change the link text instance code:
When the mouse slides over, sometimes the text in the link needs to be changed. if Javascript is used, it is better to implement it. Of course, it is not difficult to use CSS. Below is a code example like this, the following is an introduction, hoping to help those who need it.
The Code is as follows:

 

<! DOCTYPE html> 

 

The above Code meets our requirements. When the mouse is hovering over the link, the text can be switched. The following briefly introduces the implementation principle.
I. Implementation principle:
The principle is actually very simple. The English text is not displayed because the margin-top value of the span element is set to-22px, which happens to be the height of the li element, in this way, the English text is hidden. When you move the mouse over the link, the padding-top attribute value of the link is set to 22px, so that the span element can be displayed.
Ii. Related reading:
1. For details about overflow attributes, see overflow attributes in CSS.
2. a: For more information about hover, see section E: hover.

The original address is: http://www.softwhy.com/forum.php? Mod = viewthread & tid = 9629.

For more information, see: http://www.softwhy.com/divcss/

 

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.