欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

CSS3 RGBA色彩模式使用實例講解

  發(fā)布時間:2016-04-26 15:21:28   作者:佚名   我要評論
這篇文章主要以設(shè)計帶有陰影邊框的表單為例,為大家介紹了CSS3 RGBA色彩模式使用方法,感興趣的小伙伴們可以參考一下

RGBA色彩模式是RGB色彩模式的擴展,在紅,藍,綠三原色的基礎(chǔ)上增加了不透明度參數(shù)。語法如下:

rgba(r,g,b,<opaciy>)

其中r,g,b表示紅色,藍色,綠色三種原色所占的比重。其值可以使整數(shù)或者百分數(shù),正整數(shù)值的取值范圍為0~255,百分數(shù)值的取值范圍為0.0%~100.0%,超出范圍的數(shù)值將被截止其最接近的取值極限。注意,并非所有的瀏覽器都支持使用百分數(shù)值。第四個參數(shù)<opacity>表示不透明度,取值在0到1之間。

實例:設(shè)計帶有陰影邊框的表單

XML/HTML Code復(fù)制內(nèi)容到剪貼板
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
  2. <html xmlns="http://www.w3.org/1999/xhtml">  
  3. <head>  
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
  5. <title>RGBA Color</title>  
  6. <style type="text/css">  
  7. input, textarea {/*統(tǒng)一輸入域樣式*/   
  8.     padding: 4px;   
  9.     border: solid 1px #E5E5E5;   
  10.     outline: 0;   
  11.     font: normal 13px/100% Verdana, Tahoma, sans-serif;   
  12.     width: 200px;   
  13.     background: #FFFFFF;   
  14.     box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 8px;/*設(shè)計邊框陰影效果*/   
  15.     -moz-box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 8px;/*兼容Mozilla類型的瀏覽器,如FF*/   
  16.     -webkit-box-shadow: rgba(0, 0, 0, 0.1) 0px 0px 8px;/*兼容Webkit引擎,如Chrome和Safari*/     
  17. }   
  18. textarea {/*定義文本區(qū)域樣式*/   
  19.     width: 400px;   
  20.     max-width: 400px;   
  21.     height: 150px;   
  22.     line-height: 150%;   
  23.     background:url(images/form-shadow.png) no-repeat bottom right;   
  24. }   
  25. input:hover, textarea:hover, input:focus, textarea:focus { border-color: #C9C9C9; }/*設(shè)計鼠標(biāo)的動態(tài)效果*/   
  26. label {/*定義標(biāo)簽樣式*/   
  27.     margin-left: 10px;   
  28.     color: #999999;   
  29.     display:block;/*以塊狀顯示,實現(xiàn)分行顯示*/   
  30. }   
  31. .submit input {/*設(shè)計提交按鈕的樣式*/   
  32.     width:auto;   
  33.     padding: 9px 15px;   
  34.     background: #617798;   
  35.     border: 0;   
  36.     font-size: 14px;   
  37.     color: #FFFFFF;   
  38. }   
  39. </style>  
  40. </head>  
  41.   
  42. <body>  
  43. <form>  
  44.     <p class="name">  
  45.         <label for="name">姓名</label>  
  46.         <input type="text" name="name" id="name" />  
  47.     </p>  
  48.     <p class="email">  
  49.         <label for="email">郵箱</label>       
  50.         <input type="text" name="email" id="email" />  
  51.     </p>  
  52.     <p class="web">  
  53.         <label for="web">個人網(wǎng)址</label>       
  54.         <input type="text" name="web" id="web" />  
  55.     </p>  
  56.     <p class="text">  
  57.         <label for="text">留言</label>  
  58.         <textarea name="text" id="text"></textarea>  
  59.     </p>  
  60.     <p class="submit">  
  61.         <input type="submit" value="提交" />  
  62.     </p>  
  63. </form>  
  64. </body>  
  65. </html>  

演示效果:

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助。

相關(guān)文章

最新評論