2010-12-17 21 views

回答

0

您的代碼不必要的複雜。例如,您不需要將所有內容(例如每個鏈接)都包含在DIV中(或反過來)。只需直接鏈接鏈接,可能將其設置爲display樣式爲block,這樣它的行爲就像div。

如果您將兩個鏈接合併爲一個,那麼您的問題將消失,您不需要用cursor: pointer「僞造」鏈接。

下面的例子你可以HTML多麼簡單的是:

<div class="awallpost grid_doc_holder sub" data-image="http://s3.amazonaws.com/fabletest/7cgeq8hkdt"> 
    <a href="/d/1339" class="trans_caption "> 
    See the sun whispering the light of our days from last summer... 
    </a> 

    <div class="trans_caption_over"> 
    <a href="#" data-holdclass="positive_hold" data-content_id="1339" data-score="1" class="upvote_button positive overlaybutton" name=""><img src="/media/img/brightmix/star.png"> Great Find!</a> 

    <a href="/d/1339" class="extras"> 
     <em><img src="/media/img/brightmix/placedot2_white.png" align="texttop" width="12" height="auto"> Spear St. Oakland, 94107</em> 
     <span>Hey it&#39;s weekend! Whohoooo :O) Made a few new photos on my favorite heathland just outside the city, the sunset ...</span> 
    </a> 
    </div> 

    <div class="title_text_only"> 
    See the sun whispering the light of our days from last summer... 
    </div> 
    <div class="desc_text_only"> 
    Hey it&#39;s weekend! Whohoooo :O) Made a few new photos on my favorite heathland just outside the city, the sunset was so gorgeous and soft just perfect for my &amp;amp;quot;cream ... 
    </div> 
</div> 
1

嘗試將填充放置在a元素上,而不是div元素。

0

您在文本之間沒有鏈接。你有兩個鏈接。 什麼是混淆是

.grid_doc_holder { 
    cursor: pointer; 
    text-align: center; 
} 

足見其手時,你是不是在聯繫過 你可以考慮讓外部容器可點擊

0

我相信你只想把你的股利(或的div )在一個A標籤內,這將使其全部可點擊。

+1

像div這樣的塊元素不允許位於鏈接等內聯元素中。 – RoToRa 2010-12-17 10:18:55

+2

除非你使用的HTML5,你可以有塊級別的鏈接,因此嵌套鏈接 – 2010-12-17 12:13:42

+0

yes, <!DOCTYPE html>是美好的 – 2010-12-17 18:33:07