魔幻般冒泡背景的CSS3按鈕動畫

来源:https://www.cnblogs.com/good10000/archive/2019/03/23/10584439.html
-Advertisement-
Play Games

這是一款非常有特點的CSS3按鈕,按鈕的背景不是北京圖片,也不是單純的顏色,而是一組魔幻般的冒泡背景動畫。當我們將滑鼠滑過按鈕時,按鈕的冒泡背景動畫就可以展示出來。可以說這款CSS3按鈕的設計風格相當有創意,而且令人驚嘆的是,這些動畫都是用CSS3實現的,並沒有使用JavaScript,非常強大。 ...


這是一款非常有特點的CSS3按鈕,按鈕的背景不是北京圖片,也不是單純的顏色,而是一組魔幻般的冒泡背景動畫。當我們將滑鼠滑過按鈕時,按鈕的冒泡背景動畫就可以展示出來。可以說這款CSS3按鈕的設計風格相當有創意,而且令人驚嘆的是,這些動畫都是用CSS3實現的,並沒有使用JavaScript,非常強大。

 

HTML代碼:

XML/HTML Code複製內容到剪貼板
  1. <div id="buttonContainer">  
  2.   
  3.     <href="#" class="button big blue">Big Button</a>  
  4.     <href="#" class="button big green">Big Button</a>  
  5.     <href="#" class="button big orange">Big Button</a>  
  6.     <href="#" class="button big gray">Big Button</a>  
  7.   
  8.     <href="#" class="button blue medium">Medium Button</a>  
  9.     <href="#" class="button green medium">Medium Button</a>  
  10.     <href="#" class="button orange medium">Medium Button</a>  
  11.     <href="#" class="button gray medium">Medium Button</a>  
  12.   
  13.     <href="#" class="button small blue">Small Button</a>  
  14.     <href="#" class="button small green">Small Button</a>  
  15.     <href="#" class="button small blue rounded">Rounded</a>  
  16.   
  17.     <href="#" class="button small orange">Small Button</a>  
  18.     <href="#" class="button small gray">Small Button</a>  
  19.   
  20.     <href="#" class="button small green rounded">Rounded</a>  
  21.   
  22. </div>  

css3背景動畫

CSS Code複製內容到剪貼板
  1. .button{   
  2.  font:15px Calibri, Arial, sans-serif;   
  3.   
  4.  /* A semi-transparent text shadow */  
  5.  text-shadow:1px 1px 0 rgba(255,255,255,0.4);   
  6.   
  7.  /* Overriding the default underline styling of the links */  
  8.  text-decoration:none !important;   
  9.  whitewhite-space:nowrap;   
  10.   
  11.  display:inline-block;   
  12.  vertical-align:baselinebaseline;   
  13.  position:relative;   
  14.  cursor:pointer;   
  15.  padding:10px 20px;   
  16.   
  17.  background-repeat:no-repeat;   
  18.   
  19.  /* The following two rules are fallbacks, in case  
  20.     the browser does not support multiple backgrounds. */  
  21.   
  22.  background-position:bottombottom left;   
  23.  background-image:url('button_bg.png');   
  24.   
  25.  /* Multiple backgrounds version. The background images  
  26.     are defined individually in color classes */  
  27.   
  28.  background-position:bottombottom left, top rightright, 0 0, 0 0;   
  29.  background-clip:border-box;   
  30.   
  31.  /* Applying a default border raidus of 8px */  
  32.   
  33.  -moz-border-radius:8px;   
  34.  -webkit-border-radius:8px;   
  35.  border-radius:8px;   
  36.   
  37.  /* A 1px highlight inside of the button */  
  38.   
  39.  -moz-box-shadow:0 0 1px #fff inset;   
  40.  -webkit-box-shadow:0 0 1px #fff inset;   
  41.  box-shadow:0 0 1px #fff inset;   
  42.   
  43.  /* Animating the background positions with CSS3 */  
  44.  /* Currently works only in Safari/Chrome */  
  45.   
  46.  -webkit-transition:background-position 1s;   
  47.  -moz-transition:background-position 1s;   
  48.  transition:background-position 1s;   
  49. }   
  50.   
  51. .button:hover{   
  52.   
  53.  /* The first rule is a fallback, in case the browser  
  54.     does not support multiple backgrounds  
  55.  */  
  56.   
  57.  background-position:top left;   
  58.  background-position:top left, bottombottom rightright, 0 0, 0 0;   
  59. }   
  60.   
  61. .button:active{   
  62.  /* Moving the button 1px to the bottom when clicked */  
  63.  bottombottom:-1px;   
  64. }   
  65.   
  66. /* The three buttons sizes */  
  67.   
  68. .button.big  { font-size:30px;}   
  69. .button.medium { font-size:18px;}   
  70. .button.small { font-size:13px;}   
  71.   
  72. /* A more rounded button */  
  73.   
  74. .button.rounded{   
  75.  -moz-border-radius:4em;   
  76.  -webkit-border-radius:4em;   
  77.  border-radius:4em;   
  78. }   
  79.   
  80. /* Defining four button colors */  
  81.   
  82. /* BlueButton */  
  83.   
  84. .blue.button{   
  85.  color:#0f4b6d !important;   
  86.   
  87.  border:1px solid #84acc3 !important;   
  88.   
  89.  /* A fallback background color */  
  90.  background-color: #48b5f2;   
  91.   
  92.  /* Specifying a version with gradients according to */  
  93.   
  94.  background-image: url('button_bg.png'), url('button_bg.png'),   
  95.       -moz-radial-gradient( center bottombottom, circle,   
  96.             rgba(89,208,244,1) 0,rgba(89,208,244,0) 100px),   
  97.       -moz-linear-gradient(#4fbbf7, #3faeeb);   
  98.   
  99.  background-image: url('button_bg.png'), url('button_bg.png'),   
  100.       -webkit-gradient( radial, 50% 100%, 0, 50% 100%, 100,   
  101.            from(rgba(89,208,244,1)), to(rgba(89,208,244,0))),   
  102.       -webkit-gradient(linear, 0% 0%, 0% 100%, from(#4fbbf7), to(#3faeeb));   
  103. }   
  104.   
  105. .blue.button:hover{   
  106.  background-color:#63c7fe;   
  107.   
  108.  background-image: url('button_bg.png'), url('button_bg.png'),   
  109.       -moz-radial-gradient( center bottombottom, circle,   
  110.             rgba(109,217,250,1) 0,rgba(109,217,250,0) 100px),   
  111.       -moz-linear-gradient(#63c7fe, #58bef7);   
  112.   
  113.  background-image: url('button_bg.png'), url('button_bg.png'),   
  114.       -webkit-gradient( radial, 50% 100%, 0, 50% 100%, 100,   
  115.            from(rgba(109,217,250,1)), to(rgba(109,217,250,0))),   
  116.       -webkit-gradient(linear, 0% 0%, 0% 100%, from(#63c7fe), to(#58bef7));   
  117. }   
  118.   
  119. /* Green Button */  
  120.   
  121. .green.button{   
  122.  color:#345903 !important;   
  123.  border:1px solid #96a37b !important;    
  124.  background-color: #79be1e;   
  125.   
  126.  background-image:url('button_bg.png'), url('button_bg.png'), -moz-radial-gradient(center bottombottom, circle, rgba(162,211,30,1) 0,rgba(162,211,30,0) 100px),-moz-linear-gradient(#82cc27, #74b317);   
  127.  background-image:url('button_bg.png'), url('button_bg.png'), -webkit-gradient(radial, 50% 100%, 0, 50% 100%, 100, from(rgba(162,211,30,1)), to(rgba(162,211,30,0))),-webkit-gradient(linear, 0% 0%, 0% 100%, from(#82cc27), to(#74b317));   
  128. }   
  129.   
  130. .green.button:hover{   
  131.  background-color:#89d228;   
  132.   
  133.  background-image:url('button_bg.png'), url('button_bg.png'), -moz-radial-gradient(center bottombottom, circle, rgba(183,229,45,1) 0,rgba(183,229,45,0) 100px),-moz-linear-gradient(#90de31, #7fc01e);   
  134.  background-image:url('button_bg.png'), url('button_bg.png'), -webkit-gradient(radial, 50% 100%, 0, 50% 100%, 100, from(rgba(183,229,45,1)), to(rgba(183,229,45,0))),-webkit-gradient(linear, 0% 0%, 0% 100%, from(#90de31), to(#7fc01e));   
  135. }   
  136.   
  137. /* Orange Button */  
  138.   
  139. .orange.button{   
  140.  color:#693e0a !important;   
  141.  border:1px solid #bea280 !important;    
  142.  background-color: #e38d27;   
  143.   
  144.  background-image:url('button_bg.png'), url('button_bg.png'), -moz-radial-gradient(center bottombottom, circle, rgba(232,189,45,1) 0,rgba(232,189,45,0) 100px),-moz-linear-gradient(#f1982f, #d4821f);   
  145.  background-image:url('button_bg.png'), url('button_bg.png'), -webkit-gradient(radial, 50% 100%, 0, 50% 100%, 100, from(rgba(232,189,45,1)), to(rgba(232,189,45,0))),-webkit-gradient(linear, 0% 0%, 0% 100%, from(#f1982f), to(#d4821f));   
  146. }   
  147.   
  148. .orange.button:hover{   
  149.  background-color:#ec9732;   
  150.   
  151.  background-image:url('button_bg.png'), url('button_bg.png'), -moz-radial-gradient(center bottombottom, circle, rgba(241,192,52,1) 0,rgba(241,192,52,0) 100px),-moz-linear-gradient(#f9a746, #e18f2b);   
  152.  background-image:url('button_bg.png'), url('button_bg.png'), -webkit-gradient(radial, 50% 100%, 0, 50% 100%, 100, from(rgba(241,192,52,1)), to(rgba(241,192,52,0))),-webkit-gradient(linear, 0% 0%, 0% 100%, from(#f9a746), to(#e18f2b));   
  153. }   
  154.   
  155. .gray.button{   
  156.  color:#525252 !important;   
  157.  border:1px solid #a5a5a5 !important;    
  158.  background-color: #a9adb1;   
  159.   
  160.  background-image:url('button_bg.png'), url('button_bg.png'), -moz-radial-gradient(center bottombottom, circle, rgba(197,199,202,1) 0,rgba(197,199,202,0) 100px),-moz-linear-gradient(#c5c7ca, #92989c);   
  161.  background-image:url('button_bg.png'), url('button_bg.png'), -webkit-gradient(radial, 50% 100%, 0, 50% 100%, 100, from(rgba(197,199,202,1)), to(rgba(197,199,202,0))),-webkit-gradient(linear, 0% 0%, 0% 100%, from(#c5c7ca), to(#92989c));   
  162. }   
  163.   
  164. .gray.button:hover{   
  165.  background-color:#b6bbc0;   
  166.   
  167.  background-image:url('button_bg.png'), url('button_bg.png'), -moz-radial-gradient(center bottombottom, circle, rgba(202,205,208,1) 0,rgba(202,205,208,0) 100px),-moz-linear-gradient(#d1d3d6, #9fa5a9);   
  168.  background-image:url('button_bg.png'), url('button_bg.png'), -webkit-gradient(radial, 50% 100%, 0, 50% 100%, 100, from(rgba(202,205,208,1)), to(rgba(202,205,208,0))),-webkit-gradient(linear, 0% 0%, 0% 100%, from(#d1d3d6), to(#9fa5a9));   
  169. }   

您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • js代碼暫時性死區 只要塊級作用域存在let命令,它所聲明的變數就“綁定”這個區域,不再受外部的影響。這麼說可能有些抽象,舉個例子: ? 1 2 3 4 5 var temp = 123; if(true) { console.log(temp); let temp; } ? 1 2 3 4 5 v ...
  • setTimeout()函數:用來指定某個函數或某段代碼在多少毫秒之後執行。它返回一個整數,表示定時器timer的編號,可以用來取消該定時器。 例子 ? 1 2 3 4 5 console.log(1); setTimeout(function () { console.log(2); }, 0); ...
  • 一、正則表達式 1.1正則概述和體驗 正則表達式是被用來匹配字元串中的字元組合的模式,常用來做表單驗證。在JavaScript中,正則表達式也是對象,是一種引用類型。 案例:正確輸入一個電話號碼,010-12345678,用戶輸入正確返回“對”,錯誤返回“錯” 字元串的方法: split() 根據匹 ...
  • js解析器:瀏覽器中專門用來讀取js腳本解析和執行步驟: 1)找內容——根據關鍵詞:var function 參數,全部找到之後預解析結束 a = <!--undefined--> 1//所有變數在正式運行之前,都會提前賦值undefined fn = funciong fn(){ console. ...
  • 一、數組 1.1數組概念 數組(array)是一個有序的數據集合。說白了,數組就是一組數。數組內部可以存放一個或多個單獨的數據,整體組成數組。 定義數組最簡單的方式:數組字面量。 數組的字面量“[]”。習慣將數組賦值給一個變數。 數組的字面量就是方括弧,這是定義數組最簡單的方式,至於更多創建數組的方 ...
  • jquery實現點擊回到頂部 ...
  • 繁體詞庫封裝好的,直接就對應簡體轉換了 index.html zh.js load.js ...
  • 獲取當前位置所在省份城市和所用網路IP ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...