div+css布局实现中性计算器界面效果代码
代码语言:html
所属分类:布局界面
代码描述:div+css布局实现中性计算器界面效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body { display: flex; justify-content: center; align-items: center; min-height: 100vh; background-color: #eee; } .carculator { --button-width: 80px; --button-height: 80px; display: grid; grid-template-areas: "result result result result" "ac plus-minus percent add" "number-7 number-8 number-9 subtract" "number-4 number-5 number-6 multiply" "number-1 number-2 number-3 divide" "number-0 number-0 dot equal"; grid-template-columns: repeat(4, var(--button-width)); grid-template-rows: repeat(6, var(--button-height)); box-shadow: -8px -8px 16px -10px rgba(255, 255, 255, 1), 8px 8px 16px -10px rgba(0, 0, 0, 0.15); padding: 24px; border-radius: 20px; } button { margin: 8px; padding: 0; border: 0; outline: none; border-radius: calc(var(--button-height) / 2); font-size: 24px; font-weight: normal; color: #999; background: linear-gradient( 135deg, rgba(230, 230, 230, 1) 0%, rgba(246, 246, 246, 1) 100% ); box-shadow: -4px -4px 10px -8px rgba(255, 255, 255, 1), 4px 4px 10px -8px rgba(0, 0, 0, 0.3); } button:active { box-shadow: -4px -4px 10px -8px rgba(255, 255, 255, 1) inset, 4px 4px 10px -8px rgba(0, 0, 0, 0.3) inset; } .result { text-align: right; color: #666; font-size: 48px; padding: 0 20px; line-height: var(--button-height).........完整代码请登录后点击上方下载按钮下载查看
网友评论0