39 lines
705 B
HTML
39 lines
705 B
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Title</title>
|
|
</head>
|
|
<body>
|
|
<style>
|
|
.wrapper {
|
|
position: relative;
|
|
width: 200px;
|
|
height: 100px;
|
|
}
|
|
|
|
button {
|
|
position: relative;
|
|
z-index: 1;
|
|
}
|
|
|
|
.overlay {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
background: rgba(0, 0, 0, 0.3);
|
|
z-index: 2;
|
|
pointer-events: none;
|
|
}
|
|
</style>
|
|
|
|
<div class="wrapper">
|
|
<button onclick="alert('Kliknięto przycisk!')">Kliknij mnie</button>
|
|
<div class="overlay">x</div>
|
|
</div>
|
|
|
|
<!--wiemy, że pointer-events: none; blokuje kliknięcie w .overlay, ale pytanie czy przycisk zostanie kliknięty?-->
|
|
</body>
|
|
</html> |