欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

炫酷的CSS3發(fā)光搜索表單,附演示和源碼

昨天在國外的論壇上逛的時候,看到一篇帖子是求助如何利用CSS3實現(xiàn)發(fā)光效果的,網(wǎng)友回復中有一個推薦了一款CSS3發(fā)光搜索表單,利用CSS3的glow屬性,設置0%和100%時的顏色樣式,讓其漸變,再配合有明顯對比的背景,就能模擬出發(fā)光的效果了,我把那個CSS3發(fā)光表單下載了下來,先來看一下效果圖:

成都服務器托管,創(chuàng)新互聯(lián)建站提供包括服務器租用、內江機房主機托管、帶寬租用、云主機、機柜租用、主機租用托管、CDN網(wǎng)站加速、域名注冊等業(yè)務的一體化完整服務。電話咨詢:028-86922220

炫酷的CSS3發(fā)光搜索表單,附演示和源碼

圖上的搜索框在被激活的時候會出現(xiàn)閃閃發(fā)光的特效。

我們可以在這里查看CSS3發(fā)光搜索表單的DEMO演示。

下面我們來一起看看源代碼。

HTML代碼非常簡單,一個文本框和一個提交按鈕:

<form action="" method="">           
        <input type="search" placeholder="What are you looking for?">               
        <button>Search</button>
</form>

然后重點就是CSS3代碼了,首先是對搜索框和搜索按鈕的樣式進行初始化,為了配合背景能出現(xiàn)發(fā)光的效果,我們對它們的樣式作了如下設置:

.webdesigntuts-workshop {
    background: #151515;
    height: 100%;
    position: absolute;
    text-align: center;
    width: 100%;
}
.webdesigntuts-workshop:before,
.webdesigntuts-workshop:after {
    content: '';
    display: block;   
    height: 1px;
    left: 50%;
    margin: 0 0 0 -400px;
    position: absolute;
    width: 800px;
}
.webdesigntuts-workshop:before {
    background: #444;
    background: -webkit-linear-gradient(left, #151515, #444, #151515);
    background: -moz-linear-gradient(left, #151515, #444, #151515);
    background: -o-linear-gradient(left, #151515, #444, #151515);
    background: -ms-linear-gradient(left, #151515, #444, #151515);
    background: linear-gradient(left, #151515, #444, #151515);
    top: 192px;
}
.webdesigntuts-workshop:after {
    background: #000;
    background: -webkit-linear-gradient(left, #151515, #000, #151515);   
    background: -moz-linear-gradient(left, #151515, #000, #151515);   
    background: -o-linear-gradient(left, #151515, #000, #151515);   
    background: -ms-linear-gradient(left, #151515, #000, #151515);   
    background: linear-gradient(left, #151515, #000, #151515);   
    top: 191px;
}
.webdesigntuts-workshop form {
    background: #111;
    background: -webkit-linear-gradient(#1b1b1b, #111);
    background: -moz-linear-gradient(#1b1b1b, #111);
    background: -o-linear-gradient(#1b1b1b, #111);
    background: -ms-linear-gradient(#1b1b1b, #111);
    background: linear-gradient(#1b1b1b, #111);
    border: 1px solid #000;
    border-radius: 5px;
    box-shadow: inset 0 0 0 1px #272727;
    display: inline-block;
    font-size: 0px;
    margin: 150px auto 0;
    padding: 20px;
    position: relative;
    z-index: 1;
}
.webdesigntuts-workshop input {
    background: #222;
    background: -webkit-linear-gradient(#333, #222);   
    background: -moz-linear-gradient(#333, #222);   
    background: -o-linear-gradient(#333, #222);   
    background: -ms-linear-gradient(#333, #222);   
    background: linear-gradient(#333, #222);   
    border: 1px solid #444;
    border-radius: 5px 0 0 5px;
    box-shadow: 0 2px 0 #000;
    color: #888;
    display: block;
    float: left;
    font-family: 'Cabin', helvetica, arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
    height: 40px;
    margin: 0;
    padding: 0 10px;
    text-shadow: 0 -1px 0 #000;
    width: 200px;
}
.ie .webdesigntuts-workshop input {
    line-height: 40px;
}
.webdesigntuts-workshop input::-webkit-input-placeholder {
   color: #888;
}
.webdesigntuts-workshop input:-moz-placeholder {
   color: #888;
}
.webdesigntuts-workshop input:focus {
    -webkit-animation: glow 800ms ease-out infinite alternate;
    -moz-animation: glow 800ms ease-out infinite alternate;
    -o-animation: glow 800ms ease-out infinite alternate;
    -ms-animation: glow 800ms ease-out infinite alternate;
    animation: glow 800ms ease-out infinite alternate;
    background: #222922;
    background: -webkit-linear-gradient(#333933, #222922);
    background: -moz-linear-gradient(#333933, #222922);
    background: -o-linear-gradient(#333933, #222922);
    background: -ms-linear-gradient(#333933, #222922);
    background: linear-gradient(#333933, #222922);
    border-color: #393;
    box-shadow: 0 0 5px rgba(0,255,0,.2), inset 0 0 5px rgba(0,255,0,.1), 0 2px 0 #000;
    color: #efe;
    outline: none;
}
.webdesigntuts-workshop input:focus::-webkit-input-placeholder {
    color: #efe;
}
.webdesigntuts-workshop input:focus:-moz-placeholder {
    color: #efe;
}
.webdesigntuts-workshop button {
    background: #222;
    background: -webkit-linear-gradient(#333, #222);
    background: -moz-linear-gradient(#333, #222);
    background: -o-linear-gradient(#333, #222);
    background: -ms-linear-gradient(#333, #222);
    background: linear-gradient(#333, #222);
    -webkit-box-sizing: content-box;
    -moz-box-sizing: content-box;
    -o-box-sizing: content-box;
    -ms-box-sizing: content-box;
    box-sizing: content-box;
    border: 1px solid #444;
    border-left-color: #000;
    border-radius: 0 5px 5px 0;
    box-shadow: 0 2px 0 #000;
    color: #fff;
    display: block;
    float: left;
    font-family: 'Cabin', helvetica, arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
    height: 40px;
    line-height: 40px;
    margin: 0;
    padding: 0;
    position: relative;
    text-shadow: 0 -1px 0 #000;
    width: 80px;
}   
.webdesigntuts-workshop button:hover,
.webdesigntuts-workshop button:focus {
    background: #292929;
    background: -webkit-linear-gradient(#393939, #292929);   
    background: -moz-linear-gradient(#393939, #292929);   
    background: -o-linear-gradient(#393939, #292929);   
    background: -ms-linear-gradient(#393939, #292929);   
    background: linear-gradient(#393939, #292929);
    color: #5f5;
    outline: none;
}
.webdesigntuts-workshop button:active {
    background: #292929;
    background: -webkit-linear-gradient(#393939, #292929);
    background: -moz-linear-gradient(#393939, #292929);
    background: -o-linear-gradient(#393939, #292929);
    background: -ms-linear-gradient(#393939, #292929);
    background: linear-gradient(#393939, #292929);
    box-shadow: 0 1px 0 #000, inset 1px 0 1px #222;
    top: 1px;
}

最后我們將這個效果的源碼打包一份供大家參考學習。下載地址>>

名稱欄目:炫酷的CSS3發(fā)光搜索表單,附演示和源碼
文章源于:http://www.chinadenli.net/article20/ieojco.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站策劃關鍵詞優(yōu)化網(wǎng)站設計微信小程序App設計

廣告

聲明:本網(wǎng)站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)

商城網(wǎng)站建設