單純使用CSS實現動態提示資訊

來源:互聯網
上載者:User
<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 }
div#main { margin:30 }
/*關鍵代碼開始*/
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:25px; left:60px; width:130px; border:1px solid #0cf; background-color:#cff; color:#000; text-align: center }
/*關鍵代碼結束*/
</style>
<body>
<div id="main">
<h1>單純使用CSS實現動態提示資訊</h1>
<h1>不用js可以實現資訊提示效果?!(title和alt除外)</h1>
<h2>By [51js.com]zdzhuo</h2>
<h2>Ie5.5+, Opera7.0, Netscap7.0, Mozilla1.4 都能正常使用</h2>
<br><a class="info" href="javascript:;"><b>這是提示資訊</b><span>www.51js.com</span></a>不需要js就能實現的提示資訊<a class="info" href="javascript:;"><b>單純使用CSS實現提示資訊</b><span>一個非常簡便的方法<br>原理也淺顯易懂</span></a><br><br><a class="info" href="javascript:;"><img src="o_page.png" border="0"><span>這是我在51js.com的專用頭像</span></a><br><br><br>
</div>
</body>
相關文章

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.