<div style="width: 100px; height: 25px; position: relative;"> <input type="button" style="width: 100px; height: 25px;" onclick="alert(1);" value="Input"/> <div style="top: 0px; left: 0px; bottom: 0px; right: 0px; position: absolute; background-color: #000000; opacity: 0.3;"></div> </div> <br/> <div style="width: 100px; height: 25px; position: relative;"> <button style="width: 100px; height: 25px;" onclick="alert(1);">Button</button> <div style="top: 0px; left: 0px; bottom: 0px; right: 0px; position: absolute; background-color: #000000; opacity: 0.3;"></div> </div>
Когда я нажимаю на первую кнопку () в Opera 11.01, кнопка не нажимается, потому что следующая
Обновлено: Поведение:
Попробуйте добавить z-index в div
<div style="width: 100px; height: 25px; position: relative;"> <button style="width: 100px; height: 25px;" onclick="alert(1);">Inpute</button> <div style="top: 0px; left: 0px; bottom: 0px; right: 0px; position: absolute; background-color: #000000; opacity: 0.3; z-indeX: -1;"></div> </div> <br/> <div style="width: 100px; height: 25px; position: relative;"> <button style="width: 100px; height: 25px;" onclick="alert(1);">Button</button> <div style="top: 0px; left: 0px; bottom: 0px; right: 0px; position: absolute; background-color: #000000; opacity: 0.3; z-index: -1;"></div> </div>
Обновлено: JsFiddle