Use CSS to implement dynamic prompts _ CSS/HTML

Source: Internet
Author: User
Using CSS alone to implement dynamic prompt information may have been discovered to be capable of writing like this...

CSS code
A.info {
Position: relative; z-index: 0; background-color: # ccc; color: #000; text-decoration: none}

A.info: hover {
Z-index: 1; background-color: # ff0}

A.info span {
Display: none}

A.info: hover span {
Display: block; position: absolute; top: 12px; left: 2px; width: 160px; border: 1px solid # 0cf; background-color: # cff; color: #000; text-align: center}

Body area call Method
1. Text to be annotatedPrompt information

2. Prompt information

<Style> body {font: verdena; font-size: 14px; color: #000} h1 {font: verdena; font-size: 22px; color: #000} h2 {font: verdena; font-size: 15px; color: #000; text-align: left} p # main {margin: 30}/* key code start */a.info {position: relative; z-index: 0; background-color: # ccc; color: #000; text-decoration: none} a.info: hover {z-index: 1; background-color: # ff0} a.info span {display: none} a.info: hover span {dis Play: block; position: absolute; top: 25px; left: 60px; width: 130px; border: 1px solid # 0cf; background-color: # cff; color: #000; text-align: center}/* end of key code */</style> <body> <p id = "main"> How can I achieve information prompting without js by simply using CSS ?! (Except title and alt) By [51js.com] zdzhuo Ie5.5 +, Opera7.0, Netscap7.0, mozilla1.4 can be used normally. <B> This is the prompt information </B> www.51js.com, which can be implemented without js. <B> it is very easy to implement the prompt information by using CSS alone </B> this is my dedicated profile picture on 51js.com. </p> </body>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]

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.