div+css布局实现背景背光的键盘效果代码
代码语言:html
所属分类:布局界面
代码描述:div+css布局实现背景背光的键盘效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
/* General Styling */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
background: linear-gradient(135deg, #f7e4d1, #f2d3c4);
font-family: Arial, sans-serif;
color: #222;
}
.keyboard-frame {
background: #fff0db; /* Soft vintage color */
padding: 45px 25px 25px 25px; /* Space around the keyboard for the RGB glow */
border-radius: 30px; /* Extra rounded corners */
box-shadow:
0 0 5px rgba(255, 255, 255, .7), /* Soft outer glow */
0 5px 15px rgba(255, 255, 255, .5), /* Bright jelly effect */
0 10px 25px rgba(0, 0, 0, 0.5); /* Subtle depth shadow */
position: relative;
transform: translateY(-5px); /* Lift the frame slightly */
}
.keyboard-frame::before {
content: '';
position: absolute;
top: 3%; /* Adjusted for the inner glossy effect */
left: 1%; /* Adjusted for the inner glossy effect */
right: 1%; /* Adjusted for the inner glossy effect */
bottom: 3%; /* Adjusted for the inner glossy effect */
border-radius: 20px; /* Match frame shape */
background: rgba(255, 255, 255, 0.3); /* Higher opacity for gloss */
z-index: 0;
pointer-events: none;
}
/* Keyboard Base */
.keyboard {
background: rgba(255, 230, 180, 0.9); /* Slightly darker color for keys */
padding: 6px;
border-radius: 6px;
display: flex;
flex-direction: column;
gap: 0px;
position: relative;
max-width: 850px;
overflow: hidden;
}
/* Unified RGB Glow */
.keyboard::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
border-radius: 20px;
background: linear-gradient(90deg, rgba(255, 200, 0, 0.6), rgba(0, 230, 100, 0.6), rgba(0, 180, 255, 0.6), rgba(130, 30, 200, 0.6.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0