你好,我有一個我正在創建的網站。我在添加背景之前使用過的背景上有文字和按鈕。但現在他們不再工作了。他們被吸引到屏幕但不起作用。看看這段代碼一分鐘:Html和CSS按鈕不起作用
<div id = "rect0">
<div class = "banner grid_18" href="about.html">
</div>
<a href="logic.html" class="button" id ="new">View Article</a>
<div class=" grid_8 callout">
</div>
<a href="gallery.html" class="button" id ="new1">View Gallery</a>
</div>
當按鈕在div rect0之外,那麼它們的功能,但是,當他們都在裏面,他們是不能點擊。這是影響它的css包裝。
#rect0{
position: relative;
margin-top: -10px;
margin-left: 0px;
width: 951px;
height: 270px;
padding-left: 4px;
padding-top: 1px;
background: #ffffff;
z-index: -1;
}
.button{
background: #242324;
color: #B7B7B7;
padding: 6px;
color: white;
font-size: 11px;
text-transform: uppercase;
}
.button:hover{color: #d2d2d2;}
#new{
position: absolute;
margin-left: -140px;
margin-top: 220px;
}
#new1{
position: absolute;
margin-left: 117px;
margin-top: 220px;
}
我在做什麼錯誤,不允許按鈕被激活?謝謝 - 傑克。
我需要看到真人版確認
div
,但我猜這是因爲'的z指數:-1'。你有鏈接嗎? – darrylyeo