建议在Firefox或Chrome中测试,在模拟器中预览。
【示例】
-
CSS
body { font-family: "Myriad Pro", Frutiger, "Lucida Grande", "Lucida Sans", "Lucida Sans Unicode", Verdana, sans-serif; line-height: 1.2; } a.tooltip { position: relative; } a.tooltip span { display: none; } a.tooltip:hover { font-size: 100%; } a.tooltip:hover span { display: block; position: absolute; top: 1em; left: 2em; padding: 0.4em 0.6em; border: 1px solid #996633; background-color: #FFFF66; color: #000; font-size:12px; white-space:nowrap;/*强迫在一行内显示*/ }
-
HTML
<p> <a href="http://www.baidu.com/" class="tooltip">百度<span>(百度一下,你就知道)</span></a> </p>