從你的問題這是一個有點很難猜測你的工作正是你如何輸出html。但也許幫助你瞭解CSS代碼將幫助你解決你的問題。
CSS的提示取決於以下HTML結構
<!--the a element should wrap both the standard text or image-->
<a href="#" class="tooltip">
<!--tooltip text or image here -->
Tooltip
<!--the tooltip part here-->
<span>
<!--important is the class callout on the image-->
<img class="callout" src="cssttp/callout.gif" />
<!-- and this is just text that fills the tooltip-->
<strong>Most Light-weight Tooltip</strong><br />
This is the easy-to-use Tooltip driven purely by CSS.
</span>
</a>
關鍵的CSS規則如下:
a.tooltip span {
z-index:10;
display:none; /*hide the span normally*/
padding:14px 20px;
margin-top:-30px; margin-left:28px;
width:300px; line-height:16px;
}
a.tooltip:hover span{
display:inline; /*when we hover the tooltip, the span inside gets displayed inline*/
position:absolute; /*and we make sure that the tooltip doesn't move other content*/
color:#111;
border:1px solid #DCA; background:#fffAF0;
}
的CSS剩下的只是樣式它「漂亮」,但主要功能在於3條註釋行。
所以當你輸出你的代碼到html時,你需要用class tooltip產生一個'a'元素,裏面有文本(或圖像)和跨度,跨度應該有圖像課堂標註。
希望這會有所幫助。
與其向你解釋我們做了什麼,你應該分享你的代碼,也許是一個工作的例子。 – Rvervuurt
我已經解決了你的問題儘可能好,但它仍然沒有任何意義。請閱讀並確保它是可以理解的。 – Rvervuurt