
正文
【CSS】按钮
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
<!DOCTYPE html>
<html lang="en"><head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head><body>
<div class="rbutton">
<div class="rbutton-item"></div>
<div class="rbutton-item"></div>
<div class="rbutton-item"></div>
<div class="rbutton-item"></div>
<div class="rbutton-item"></div>
</div>
</body></html><style>
html,
body {
width: 100%;
height: 100vh;
padding: 0;
margin: 0;
background-color: #fff;
background-image: linear-gradient( 109.6deg, rgba(24,138,141,1) 11.2%, rgba(96,221,142,1) 91.1% );
} .rbutton {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
flex-direction: row;
} .rbutton-item {
transition: .2s;
width: 100px;
height: 100px;
margin: 10px;
background-color: rgba(255, 255, 255, .1);
;
border-radius: 20px;
box-shadow:
8px 8px 16px rgba(0, 0, 0, .3),
inset 8px 8px 16px rgba(255, 255, 255, .3),
inset -8px -8px 16px rgba(0, 0, 0, .3);
} .rbutton-item:hover {
transform: translateY(-2px);
box-shadow:
8px 8px 16px rgba(0, 0, 0, .3),
inset 8px 8px 16px rgba(255, 255, 255, .3),
inset -8px -8px 16px rgba(0, 0, 0, .3);
} .rbutton-item:active {
transform: scale(1.05);
border-radius: 25px;
box-shadow:
4px 4px 8px rgba(0, 0, 0, .3),
inset 4px 4px 8px rgba(255, 255, 255, .3),
inset -4px -4px 8px rgba(0, 0, 0, .3);
}
</style>
Document
html, body { width: 100%; height: 100vh; padding: 0; margin: 0; background-color: rgba(255, 255, 255, 1); background-image: linear-gradient(109.6deg, rgba(24, 138, 141, 1) 11.2%, rgba(96, 221, 142, 1) 91.1%) }
.rbutton { width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; flex-direction: row }
.rbutton-item { transition: 0.2s; width: 100px; height: 100px; margin: 10px; background-color: rgba(255, 255, 255, 0.1); border-radius: 20px; box-shadow: 8px 8px 16px rgba(0, 0, 0, 0.3), inset 8px 8px 16px rgba(255, 255, 255, 0.3), inset -8px -8px 16px rgba(0, 0, 0, 0.3) }
.rbutton-item:hover { transform: translateY(-2px); box-shadow: 8px 8px 16px rgba(0, 0, 0, 0.3), inset 8px 8px 16px rgba(255, 255, 255, 0.3), inset -8px -8px 16px rgba(0, 0, 0, 0.3) }
.rbutton-item:active { transform: scale(1.05); border-radius: 25px; box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3), inset 4px 4px 8px rgba(255, 255, 255, 0.3), inset -4px -4px 8px rgba(0, 0, 0, 0.3) }






