پیشنمایش زنده
کد HTML
<button class="outer-btn">
<div class="shadow-down"></div>
<div class="inner-btn">
<span class="btn-text">Enter</span>
<span class="btn-icon">⏎</span>
</div>
</button>
کد CSS
/* Outer Button Container */
.outer-btn {
position: relative;
cursor: pointer;
width: 240px;
height: 80px;
background-size: 240px 80px;
background-position: 0px 0px;
background: linear-gradient(
to bottom,
darkgray,
lightgray,
lightgray,
rgb(238, 238, 238)
); /* Linear gradient */
display: flex;
align-items: center;
justify-content: center;
border-radius: 8px;
overflow: hidden;
}
.outer-btn::after {
content: "";
position: absolute;
top: 65%;
left: 100%;
width: 10px;
height: 50px;
background-color: #fefcfc;
filter: blur(3px);
transform: rotateZ(-45deg) translateX(-50%) translateY(-50%);
z-index: 1;
}
.outer-btn::before {
content: "";
position: absolute;
top: 65%;
left: 0%;
width: 10px;
height: 50px;
background-color: #fefcfc;
filter: blur(3px);
transform: rotateZ(45deg) translateX(-50%) translateY(-50%);
z-index: 1;
}
/* Hover Effect for Outer Button */
.outer-btn:hover {
transform: translateY(-2px);
box-shadow: 0 4px 4px rgba(0, 0, 0, 0.3);
}
/* Inner Button */
.inner-btn {
width: 220px;
height: 60px;
background: linear-gradient(
to bottom,
white 0%,
lightgray 10%,
lightgray 85%,
darkgray 100%
); /* Linear gradient */
border-radius: 8px;
border: 2px solid white;
margin-top: -10px;
display: flex;
justify-content: center;
align-items: center;
box-shadow:
inset 0px 0px 2px rgba(255, 255, 255, 0),
inset -1px -1px 2px rgba(0, 0, 0, 0);
transition: box-shadow 0.1s ease;
z-index: 9;
}
/* Hover Effect for Inner Button */
.outer-btn:hover .inner-btn {
box-shadow:
inset 2px 2px 4px rgba(255, 255, 255, 0.8),
inset -2px -2px 4px rgba(0, 0, 0, 0.3);
}
/* Button Text */
.btn-text {
font-size: 20px;
font-weight: bold;
color: #333;
margin-right: 8px;
}
/* Button Icon */
.btn-icon {
font-size: 24px;
color: #333;
}
.outer-btn:active .inner-btn {
margin-top: 0px;
}