国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > CSS > 正文

純CSS實現3D按鈕效果實例代碼

2024-07-11 08:58:08
字體:
來源:轉載
供稿:網友

今天分享一個用純CSS實現的3D按鈕。

css巧妙利用了box-shadow來實現3D物體的立體感,當按鈕按下的時候再去修改box-shadow和top值。

讓人感覺有一種按鈕被按下的感覺。css代碼非常少,如下所示

a.css-3d-btn{ position: relative; color: rgba(255, 255, 255, 1); text-decoration: none; background-color: rgba(219, 87, 51, 1); font-family: "Microsoft YaHei", 微軟雅黑, 宋體; font-weight: 700; font-size: 3em; display: block; padding: 4px; border-radius: 8px; /* let's use box shadows to make the button look more 3-dimensional */ box-shadow: 0px 9px 0px rgba(219, 31, 5, 1), 0px 9px 25px rgba(0, 0, 0, .7); margin: 100px auto; width: 160px; text-align: center; -webkit-transition: all .1s ease; -moz-transition: all .1s ease; transition: all .1s ease;}/* now if we make the box shadows smaller when the button is clicked, it'll look like the button has been "pushed" */a.css-3d-btn:active{ box-shadow: 0px 3px 0px rgba(219, 31, 5, 1), 0px 3px 6px rgba(0, 0, 0, .9); position: relative; top: 6px;}

效果如下:

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持武林網。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 古蔺县| 鄄城县| 昆山市| 沙河市| 濮阳县| 东平县| 舟山市| 剑阁县| 巨野县| 玉树县| 红河县| 沛县| 新平| 扬中市| 昆明市| 莲花县| 资源县| 游戏| 通江县| 革吉县| 玉门市| 巴彦县| 常山县| 耿马| 三穗县| 团风县| 肇源县| 札达县| 喀喇沁旗| 深水埗区| 咸阳市| 方山县| 南川市| 应用必备| 淳安县| 东莞市| 鄱阳县| 明溪县| 苍南县| 墨竹工卡县| 满城县|