2014-09-05 85 views
0

我有一個問題,當我嘗試點擊一個div它不能重定向。當我右鍵單擊鼠標不顯示在新標籤菜單中打開

<div class="blockquote-box blockquote-success clearfix"> 

<div class="square pull-left ui-draggable ui-draggable-handle"> 
    <img class="Width_40" src="Allbill.png" alt=""> 
    <span class="fa fa-heart fav-link FontSize-18" title="" data-original-title="Add to My Favorites"></span> 
</div> 
<a href="/customer/customerbilldetails"> 
    <h4> 
     Bill Listing 
    </h4> 

    <p> 
     Report listing bill details. 
    </p> 
</a> 

我使用的標籤。內部具有的所有元素的標籤, enter image description here

當我右擊鼠標不會顯示在新的選項卡菜單中打開... 我怎麼能解決這個...請任何人的幫助。

回答

4

「打開新標籤」其他類似選項僅出現在鏈接中(<a>)。您必須將所有內容放入<a>。從技術上講,它會打破「嵌入元素內部沒有塊元素」規則。但是,您可以將<a>設置爲display:block,因此它的行爲如同<div>

類似的情況在這裏:A clickable <li> using an <a> tag - no JS to be used. Is it legal HTML?

+0

感謝ü這麼多先生 – Sankar 2014-09-05 10:09:36

+1

這個答案是誤導性的。 HTML5允許這樣做。 「只要內部沒有交互式內容(例如按鈕或其他鏈接),a元素可能會纏繞整個段落,列表,表格等等甚至整個部分」http://www.w3.org/ TR/html5/text-level-semantics.html#這是一個元素 – MikeSmithDev 2014-09-05 10:23:18

+0

滾動點擊正在工作,但右鍵點擊鼠標並點擊新標籤不可用。 – Sankar 2014-10-28 05:35:16

相關問題