0
這麼愚蠢的問題,我知道,但我轉圈圈......我有HTML的此位....使整個DIV區域點擊
<div class="navbtn"> <p><a class="nav-toggle" href="#"><span></span></a>Menu</p>
</div>
類「NAV-切換」是指漢堡包,它位於div navbtn內,旁邊有單詞菜單....我基本上想讓navbtn的整個區域可點擊,因爲此刻我只能點擊漢堡包圖標本身,而沒有其他東西......用於navbtn和NAV-肘節(漢堡)的CSS是如下
.nav-toggle { position: absolute; left: 15px; top: 25px; outline: 0; z-index : 9999; display: inline-block;}
.nav-toggle { cursor: pointer;}
.nav-toggle span, .nav-toggle span:before, .nav-toggle span:after {
cursor: pointer;
height: 5px;
width: 45px;
background: white;
position: absolute;
display: inline-block;
content: '';
outline: 0;
}
.nav-toggle span:before {
top: -10px;
}
.nav-toggle span:after {
bottom: -10px;
}
input::-moz-focus-inner {
border: 0;
}
.nav-toggle span, .nav-toggle span:before, .nav-toggle span:after {
transition: all 500ms ease-in-out;
outline: 0;
}
.nav-toggle.active span {
background-color: transparent;
outline: 0;
}
.nav-toggle.active span:before, .nav-toggle.active span:after {
top: 0;
outline: 0;
}
.nav-toggle.active span:before {
transform: rotate(45deg);
}
.nav-toggle.active span:after {
transform: rotate(-45deg);
}
而navbtn DIV
.navbtn {
position: fixed;
left: 10px;
top: 10px;
display: inline-block;
padding: 8px;
background-color: transparent;
width: auto;
color: #ffffff;
cursor: pointer;
}
.navbtn p {
margin: 0;
padding: 0 2.4em 0.6em;
font-size: 1.7em;
line-height: 1.5;
color : #fff;
cursor: pointer;
}
究竟是什麼,我在想:) – AmmarCSE
同意,但在這種情況下,它不會工作,因爲我有一個jQuery腳本,基本上說「onclick」做它的意思是做...我其實不需要錨來想想...嗯 – havingagoatit
如果你有一個onclick那麼你可以將onclick附加到'.navbutton' – jcuenod