当前位置:网站首页>A three-dimensional button
A three-dimensional button
2022-07-05 05:03:00 【Fierce chicken】
A three-dimensional button
Change button button
Default style for , Create a stereo button
This effect is achieved by box-shadow
Realization
Pay attention here box-shadow
It allows multiple shadows to be set on the same element , Need to be separated by commas ;
The stacking order of multiple shadows is : The shadow written in front will cover the shadow written in the back
Demo link
CodePen Demo link :https://codepen.io/Zhao-Bocheng/pen/zYwrPEL
Source code
<!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> Stereo buttons </title>
<style> * {
padding: 0; margin: 0; } body {
display: flex; justify-content: center; align-items: center; height: 100vh; background-color: #f1f1f1; } button {
font-family: Helvetica, sans-serif; border: 0; background-color: white; width: 100px; height: 100px; border-radius: 20px; /* The key is to use only this Box shadow The style of */ box-shadow: -6px 6px 8px inset rgba(255, 255, 255, .6), 6px -6px 8px inset rgba(0, 0, 0, .2); } button:active {
box-shadow: -6px 6px 8px inset rgba(0, 0, 0, .2), 6px -6px 8px inset rgba(255, 255, 255, .6); } </style>
</head>
<body>
<button>Btn</button>
</body>
</html>
Reference resources :https://www.bilibili.com/video/BV1w64y1b7eF
边栏推荐
- 2021 electrician cup idea + code - photovoltaic building integration plate index development trend analysis and prediction: prediction planning issues
- 2021 huashubei mathematical modeling idea + reference + paper
- The difference between heap and stack
- Unity synergy
- cocos_ Lua listview loads too much data
- Unity sends messages and blocks indecent words
- Unity intelligent NPC production -- pre judgment walking (method 1)
- [leetcode] integer inversion [7]
- 中国AS树脂市场调研与投资预测报告(2022版)
- Vs2015 secret key
猜你喜欢
Emlog博客主题模板源码简约好看响应式
669. Prune binary search tree ●●
How to choose a panoramic camera that suits you?
Leetcode word search (backtracking method)
Rip notes [rip three timers, the role of horizontal segmentation, rip automatic summary, and the role of network]
Thinking of 2022 American College Students' mathematical modeling competition
54. 螺旋矩阵 & 59. 螺旋矩阵 II ●●
Data is stored in the form of table
2022 thinking of mathematical modeling C problem of American college students / analysis of 2022 American competition C problem
AutoCAD - feature matching
随机推荐
Unity card flipping effect
Introduction to JVM principle and process
【Leetcode】1352. Product of the last K numbers
MD5绕过
Detailed explanation of the ranking of the best universities
AutoCAD - workspace settings
Lua determines whether the current time is the time of the day
Unity get component
2022 thinking of Mathematical Modeling B problem of American college students / analysis of 2022 American competition B problem
AutoCAD - stretching
3dsmax scanning function point connection drawing connection line
Data is stored in the form of table
中国AS树脂市场调研与投资预测报告(2022版)
Solutions and answers for the 2021 Shenzhen cup
UE fantasy engine, project structure
775 Div.1 B. integral array mathematics
#775 Div.1 B. Integral Array 数学
2021 huashubei mathematical modeling idea + reference + paper
Unity connects to the database
AutoCAD - Document Management