2014-09-25 54 views
0

this page右上角,我們可以看到我創建的按鈕「現在提問」。我設置了背景顏色,背景圖像和高Z指數,但是,下面的文本仍然在流血。DIV與下面的內容流血?

如何阻止?我不知道如何解決這個問題,甚至爲什麼會這樣......

<div class="clearfix grpelem" id="u181-4"><!-- content --> 
<style> 
    #ContactButton { 
     margin-bottom: 5px; 
    } 

    #ContactButtonContainer { 
     margin-top: -50px; 
     position: relative; 
    } 

    #ContactFormContainer { 
     width: 250px; 
     height: 160px; 
     border: 1px solid black; 
     position: absolute; 
     top: -5px; 
     left: -52px; 
     z-index: 1001; 
     background-color: #fff; 
     background-image: url("images/formbg.jpg"); 
     background-repeat: repeat; 
    } 
</style> 
<script> 
    function ToggleContactFormContainer() { 
     var FormContainer = document.getElementById("ContactFormContainer"); 

     if(FormContainer.style.display == "none") { 
      FormContainer.style.display = "block"; 
     } 
     else { 
      FormContainer.style.display = "none"; 
     } 
    } 
</script> 
    <p id="ContactButtonContainer"><img src="images/ContactButton.jpg" id="ContactButton" onclick="ToggleContactFormContainer()"><br><b>CALL US TODAY (219) 221-6500</b>&nbsp;&nbsp;</p> 
    <div id="ContactFormContainer" style="display: none;"> 
    Test 
    </div> 
</div> 

回答

1

的問題是,#u181-4元素具有6的z-index和接觸形式裏面;這限制了整個頁面相對於頁面的z順序。

除非#u181-4需要有一個z-index,只要將它保持在自動狀態,它就能正常工作。

+0

好,我沒有深入到這個深處。除了瘋狂ethe問題#u4715的ID。先生,非常感謝。 – HelpNeeder 2014-09-25 16:11:23

+0

沒關係。你完全正確。 :) – HelpNeeder 2014-09-25 19:37:17

+0

很高興我能幫助:-) – 2014-09-25 19:38:52