当前位置:网站首页>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
边栏推荐
- 54. Spiral matrix & 59 Spiral matrix II ●●
- AutoCAD - set layer
- Forecast report on research and investment prospects of Chinese wormwood industry (2022 Edition)
- Do a small pressure test with JMeter tool
- 嵌入式数据库开发编程(六)——C API
- Unity intelligent NPC production -- pre judgment walking (method 1)
- AutoCAD - graphic input and output
- 2022 thinking of mathematical modeling a problem of American college students / analysis of 2022 American competition a problem
- An article takes you to thoroughly understand descriptors
- 2020-10-27
猜你喜欢
Pdf to DWG in CAD
54. 螺旋矩阵 & 59. 螺旋矩阵 II ●●
win10虚拟机集群优化方案
Download and use of font icons
Unity find the coordinates of a point on the circle
Ue4/ue5 illusory engine, material part (III), material optimization at different distances
2022 thinking of Mathematical Modeling B problem of American college students / analysis of 2022 American competition B problem
Emlog blog theme template source code simple good-looking responsive
Create a pyGame window with a blue background
stm32Cubemx(8):RTC和RTC唤醒中断
随机推荐
mysql审计日志归档
Database under unity
Unity synergy
質量體系建設之路的分分合合
Unity ugui source code graphic
Number theoretic function and its summation to be updated
win下一键生成当日的时间戳文件
2021 electrician cup idea + code - photovoltaic building integration plate index development trend analysis and prediction: prediction planning issues
cocos_ Lua loads the file generated by bmfont fnt
Common database statements in unity
BUUCTF MISC
Cocos2dx screen adaptation
775 Div.1 C. Tyler and strings combinatorial mathematics
Rip notes [rip three timers, the role of horizontal segmentation, rip automatic summary, and the role of network]
AutoCAD - feature matching
LeetCode之單詞搜索(回溯法求解)
中国AS树脂市场调研与投资预测报告(2022版)
AutoCAD - stretching
Ue4/ue5 illusory engine, material part (III), material optimization at different distances
MySQL audit log Archive