当前位置:网站首页>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
边栏推荐
- 中国聚氨酯硬泡市场调研与投资预测报告(2022版)
- 2022/7/2 question summary
- win10虚拟机集群优化方案
- Research and investment forecast report of adamantane industry in China (2022 Edition)
- #775 Div.1 C. Tyler and Strings 组合数学
- AutoCAD - scaling
- Pdf to DWG in CAD
- Unity get component
- 2022 thinking of mathematical modeling a problem of American college students / analysis of 2022 American competition a problem
- cocos_ Lua listview loads too much data
猜你喜欢
django连接数据库报错,这是什么原因
win10虚拟机集群优化方案
嵌入式数据库开发编程(零)
669. Prune binary search tree ●●
2022 thinking of mathematical modeling C problem of American college students / analysis of 2022 American competition C problem
Thinking of 2022 American College Students' mathematical modeling competition
XSS injection
AutoCAD - full screen display
UE4/UE5 虚幻引擎,材质篇(三),不同距离的材质优化
AutoCAD - isometric annotation
随机推荐
AutoCAD - command repetition, undo and redo
AutoCAD - isometric annotation
Unity find the coordinates of a point on the circle
Unity ugui source code graphic
Pause and resume of cocos2dx Lua scenario
Common technologies of unity
mysql審計日志歸檔
win下一键生成当日的时间戳文件
AutoCAD - workspace settings
2021 Higher Education Club Cup mathematical modeling national tournament ABCD problem - problem solving ideas
中国AS树脂市场调研与投资预测报告(2022版)
Cocos progress bar progresstimer
2022 / 7 / 1 Résumé de l'étude
2021 higher education social cup mathematical modeling national tournament ABCD questions - problem solving ideas - Mathematical Modeling
3dsmax common commands
Redis has four methods for checking big keys, which are necessary for optimization
Out and ref functions of unity
MySQL audit log Archive
PostgreSQL surpasses mysql, and the salary of "the best programming language in the world" is low
Cocos2dx screen adaptation