<div class="container">
<a class="btn">Кнопка 1</a>
<a class="btn">Кнопка 2</a>
<a class="btn">Кнопка 3</a>
<a class="btn">Кнопка 4</a>
<a class="btn">Кнопка 5</a>
</div>
body {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
gap: 80px;
min-height: 100vh;
background: linear-gradient(to bottom, #fff9ff, #ffe5b1);
font-family: tahoma;
padding: 0;
margin: 0;
}
.container {
width: 70%;
box-sizing: border-box;
padding: 50px;
background-color: orange;
display: flex;
justify-content:center;
align-items: center;
flex-direction: column;
position: relative;
z-index: 0;
border-radius: 10px;
gap: 10px;
}
.btn {
text-align: center;
background-color: #603d11;
padding: 20px 40px;
border-radius: 10px;
cursor: pointer;
display: block;
color: #fff;
text-transform: uppercase;
transition: .2s all;
position: relative;
z-index: 0;
}
.btn:after {
content: "";
display: block;
position: absolute;
left: 0;
right: 0;
top: -5px;
bottom: -5px;
z-index: -1;
}
/* Вся магия тут */
/* All the magic is here */
.container:has(.btn:hover) .btn:not(:hover) {
opacity: .5;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.