2013-02-28 73 views
0

我想知道是否有可能在CSS表後面有可點擊的鏈接。 當圖像爲40px時,無法選擇背後的鏈接。如何在HTML中的表格後面保留可點擊的鏈接?

爲什麼我在一個表中進行是因爲每個文本塊必須是248px(3分之744)

CSS

#tabel{ 
    position:absolute; 
} 
table, td, th 
{ 
width:744px; 
height:40px; 
text-align:center; 
} 
th 
{ 
background-color:transparent; 
color:white; 
} 

HTML:

<div id="tabel">  
    <table cellspacing="0" cellpadding="0"> 
    <tr> 
     <th>TXT 1</th> 
     <th>TXT 2</th> 
     <th>TXT 3</th> 
    </tr> 
    </table> 
</div> 

我的目標是有3個可點擊的按鈕(對於帶有導航的jquery圖像滑塊),其上有文本。

+0

你爲什麼不顯示:沒有任何按鈕,直到是時候給他們看? – Lowkase 2013-02-28 15:39:36

+0

爲什麼不在'th'上設置事件處理程序? – iappwebdev 2013-02-28 15:49:12

+0

因爲這會刪除文本?我想要看到.. – Marcel 2013-02-28 15:49:31

回答

0

你可能想採取這樣的做法無表:http://jsfiddle.net/t4tBt/

CSS

a.mybutton { 
    display:block; 
    width:248px; 
    height:30px; 
    float:left; 
    text-align:center; 
    vertical-align:middle; 
    color:#999; 
    text-decoration:none; 
    padding-top:10px; 
} 
a.first{ 
    background:url('http://www.trade-website.co.uk/wp-content/uploads/2013/02/simple_blue_background-wallpaper-1920x1080.jpg'); 
} 
a.second { 
background:url('http://www.trade-website.co.uk/wp-content/uploads/2013/02/simple_blue_background-wallpaper-1920x1080.jpg'); 
} 
a.last { 
background:url('http://www.trade-website.co.uk/wp-content/uploads/2013/02/simple_blue_background-wallpaper-1920x1080.jpg'); 
} 

HTML

<div id="tabel"> 
<a href="http://www.google.com" class="mybutton first">First Button</a> 
<a href="http://www.google.com" class="mybutton second">Second Button</a> 
<a href="http://www.google.com" class="mybutton last">Third Button</a> 
</div> 
+0

修正了它,thnx!雖然仍然不能點擊jquery中的下層圖像。 – Marcel 2013-02-28 19:20:58

相關問題