How can I use css to hover the mouse over the tip?

Source: Internet
Author: User

Hovering over the tip is a very useful function. When the page layout is limited, we cannot add too much content to the page. When you move the mouse over the tip, you can have a prompt. We can place the related information in the tip, it does not affect the appearance of the page, but can convey information well.

Can we use css to apply div + CSS layout to achieve this effect? In fact, this is very simple. We can create a new span or div and set it to: display: none to hide the content of this label. (For more information about display, see here.) when you move the mouse up, we will display this content. Then locate it. The mouse hover tip effect is achieved.


Hover the mouse over the CSS code of the tip effect instance

The code is as follows: Copy code
A # tip {position: relative; left: 30px; top: 30px ;}
A # tip: link {text-decoration: none; color: # c00; display: block}
A # tip: hover {text-decoration: none; color: #000; display: block}
A # tip span {display: none ;}
A # tip: hover # tip_info {
Display: block;
Border: 1px dashed # c00;
Background: # fff;
Padding: 1px;
Position: absolute;
Top: 0px;
Left: 120px;
}
The XHTML code of the instance with the mouse hovering over the tip effect
The code is as follows: Copy code
<A id = "tip" href = "http: //"> 【]
<Span id = "tip_info">
Alt = "" width = "200" height = "90"/>
</Span>
</A>

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.