我目前有一個位於輸入字段上的字體超讚圖標。我希望圖標可以點擊,但我似乎無法使其工作。我已經將它包裹在一個跨度中,並更改了跨度光標,但它看起來沒有任何影響。可點擊的字體輸入裏面的真棒圖標
下面的代碼:
.inner-addon {
position: relative;
}
.inner-addon .fa {
position: absolute;
padding: 10px;
pointer-events: none;
}
.left-addon .fa {
left: 0px;
}
.right-addon .fa {
right: 0px;
}
.left-addon input {
padding-left: 30px;
}
.right-addon input {
padding-right: 30px;
}
#locationClickableIcon {
cursor: pointer;
}
<span id="locationClickableIcon"><i class="fa fa-crosshairs" id='autolocate'></i></span>
<input type="text" id="address" placeholder="Zipcode" value="" />
點擊正常工作(https://jsfiddle.net/o2vg3men/1/)。點擊時你想要發生什麼? – Turnip
對我來說,圖標位於輸入框的內部,不可點擊。 –
@JakeOls你沒有顯示它真的失敗的地方。我們應該如何幫助解決問題? –