2015-06-21 128 views
1

I have a rollover effect over an image which can be seen here: http://www.sdimmigrationlawyers.com/(頁面底部 - 驅逐出境圖片)CSS和<a href> issue

我想添加一個鏈接,但我的標籤不起作用。我應該如何實現它(1)具有翻轉效果,和(2)有鏈接?

CSS:

<div class="view view-sixth"> 
<img class="alignleft wp-image-335 size-full" alt="" src="http://www.sdimmigrationlawyers.com/wp-content/uploads/2015/06/deportation.jpg"> 
    <a href="http://www.sdimmigrationlawyers.com/immigration-services/deportation-defense"> 
     <div class="mask"></div> 
    </a> 
    <p> 
     <a href="http://www.sdimmigrationlawyers.com/immigration-services/deportation-defense"></a> 
    </p> 
    <div class="content"> 
     <h2>Deportation Defense</h2> 
    </div> 
</div> 

HTML:

<div class="paragraph_dui_crime_box2"> 
<h2>San Diego Deportation Lawyer</h2> 
<div class="view view-sixth"> 
    <img class="alignleft wp-image-335 size-full" src="http://www.sdimmigrationlawyers.com/wp-content/uploads/2015/06/deportation.jpg" alt="" /> 
    <a href="http://www.sdimmigrationlawyers.com/immigration-services/deportation-defense"> 
     <div class="mask"></div> 
    </a> 
    <div class="content"> 
     <h2>Deportation Defense</h2> 
    </div> 
</div> 
+0

只要把錨標記周圍的'h2'。 – DRD

回答

2

你可以嘗試包裹<a>標籤周圍的整段像這樣:

<a href="http://www.sdimmigrationlawyers.com/immigration-services/deportation-defense"> 
    <img class="alignleft wp-image-335 size-full" alt="" src="http://www.sdimmigrationlawyers.com/wp-content/uploads/2015/06/deportation.jpg"> 
    <div class="mask"></div> 
    <p> 
    <a href="http://www.sdimmigrationlawyers.com/immigration-services/deportation-defense"></a> 
    </p> 
    <div class="content"> 
     <h2>Deportation Defense</h2> 
    </div> 
</a> 
2

你的大標題是 「CSS」 的代碼是HTML,所以我以爲這是什麼是你的網頁的HTML代碼。

如果在HTML的標記沒有任何限制,請執行下列操作,並確保與H2的DIV被包裹在一個錨領先的地方:

<a href="..."> 
    <div class="content"><h2>Deportation Defense</h2></div> 
</a> 

目前,你的錨周圍用東西沒有內容(不可點擊),另一邊的內容沒有正確包裝在錨點中(因此它不可點擊)。