2011-10-12 73 views

回答

2

這樣寫:

.tooltip span.info { 
    display:none; 
    position: absolute; 
    white-space:nowrap; 
    border-radius: 5px 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; 
    box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.1); 
    -webkit-box-shadow: 5px 5px rgba(0, 0,0, 0.1); 
    -moz-box-shadow: 5px 5px rgba(0, 0, 0, 0.1); 
    font-family: Calibri, Tahoma, Geneva, sans-serif; 
    margin-left: 0; 
    z-index: 1; 
    top:20px; 
    right:0; 
} 

檢查這個http://jsfiddle.net/sandeep/Q55C8/5/

+0

感謝您的幫助!我需要動態的這意味着'正確:-146px'對我的問題是不正確的。你可以在改變'td'的寬度時看到效果。你有什麼想法嗎? – shub

+1

@shub;檢查更新的小提琴http://jsfiddle.net/sandeep/Q55C8/7/ – sandeep

+0

你很好,非常感謝你。我還有一個小問題?我該如何修改代碼才能使「工具提示」在'td'中居中? – shub

0

只需將工具提示的位置設置爲絕對位置(固定位置,修復相對於窗口的工具提示而不是鏈接)並使用right:xx css樣式調整位置。

a.tooltip:hover span.info { display: block; position: absolute; right:-146px } 

演示

http://jsfiddle.net/Q55C8/4/

+0

爲什麼你給正確的:-146px? – sandeep

+0

該鏈接被設置爲相對位置,他可以通過將td設置爲相對位置來繞過該鏈接,但由於我不知道他的設置,我儘可能做出儘可能小的更改。 –