CSS3製作炫酷的自定義發光文字
導語:CSS3製作炫酷的自定義發光文字。本文為大家分享一款基於純CSS3的文字發光特效,當我們將鼠標滑過文字時,文字就會模擬發光動畫,展現出非常酷的發光畫面。另外,由於引用了特殊字體,所以整個文字效果看起來有着3D立體的特效,如果你的網絡無法加載這些字體,可能是由於國外的這個網站被牆的'緣故,就像google的字體庫網址被屏蔽那樣。
HTML代碼
XML/HTML Code複製內容到剪貼板
<p id="container">
<p><a href="#">
RED
</a></p>
<p><a href="#">
BLUE
</a></p>
<p><a href="#">
Yellow
</a></p>
<p><a href="#">
GREEN
</a></p>
<p><a href="#">
ORANGE
</a></p>
<p><a href="#">
VIOLET
</a></p>
</p>
CSS代碼
CSS Code複製內容到剪貼板
/*setup*/
*{
margin: 0;
padding: 0;
}
@font-face {
font-family: 'Monoton';
font-style: normal;
font-weight: 400;
src: local('Monoton'), local('Monoton-Regular'), url(_) format('woff');
}
@font-face {
font-family: 'Iceland';
font-style: normal;
font-weight: 400;
src: local('Iceland'), local('Iceland-Regular'), url() format('woff');
}
@font-face {
font-family: 'Pacifico';
font-style: normal;
font-weight: 400;
src: local('Pacifico Regular'), local('Pacifico-Regular'), url(_) format('woff');
}
@font-face {
font-family: 'PressStart';
font-style: normal;
font-weight: 400;
src: local('Press Start 2P'), local('PressStart2P-Regular'), url(_) format('woff');
}
@font-face {
font-family: 'Audiowide';
font-style: normal;
font-weight: 400;
src: local('Audiowide'), local('Audiowide-Regular'), url() format('woff');
}
@font-face {
font-family: 'Vampiro One';
font-style: normal;
font-weight: 400;
src: local('Vampiro One'), local('VampiroOne-Regular'), url(_) format('woff');
}
body{
background-color: #222222;
}
#container{
margin:auto;
}
/*neeeeoooon*/
p{
text-align:center;
font-size:7em;
margin:20px 0 20px 0;
}
a{
text-decoration:none;
-webkit-transition: all 0.5s;
-moz-transition: all 0.5s;
transition: all 0.5s;
}
p:nth-child(1) a{
color:#FF1177;
font-family:Monoton;
}
p:nth-child(1) a:hover{
-webkit-animation: neon1 1.5s ease-in-out infinite alternate;
-moz-animation: neon1 1.5s ease-in-out infinite alternate;
animation: neon1 1.5s ease-in-out infinite alternate;
}
p:nth-child(2) a{
font-size:1.5em;
color:#228DFF;
font-family:Iceland;
}
p:nth-child(2) a:hover{
-webkit-animation: neon2 1.5s ease-in-out infinite alternate;
-moz-animation: neon2 1.5s ease-in-out infinite alternate;
animation: neon2 1.5s ease-in-out infinite alternate;
}
p:nth-child(3) a{
color:#FFDD1B;
font-family:Pacifico;
}
p:nth-child(3) a:hover{
-webkit-animation: neon3 1.5s ease-in-out infinite alternate;
-moz-animation: neon3 1.5s ease-in-out infinite alternate;
animation: neon3 1.5s ease-in-out infinite alternate;
}
p:nth-child(4) a{
color:#B6FF00;
font-family:PressStart;
font-size:0.8em;
}
p:nth-child(4) a:hover{
-webkit-animation: neon4 1.5s ease-in-out infinite alternate;
-moz-animation: neon4 1.5s ease-in-out infinite alternate;
animation: neon4 1.5s ease-in-out infinite alternate;
}
p:nth-child(5) a{
color:#FF9900;
font-family:Audiowide;
}
p:nth-child(5) a:hover{
-webkit-animation: neon5 1.5s ease-in-out infinite alternate;
-moz-animation: neon5 1.5s ease-in-out infinite alternate;
animation: neon5 1.5s ease-in-out infinite alternate;
}
p:nth-child(6) a{
color:#BA01FF;
font-family:Vampiro One;
}
p:nth-child(6) a:hover{
-webkit-animation: neon6 1.5s ease-in-out infinite alternate;
-moz-animation: neon6 1.5s ease-in-out infinite alternate;
animation: neon6 1.5s ease-in-out infinite alternate;
}
p a:hover{
color:#ffffff;
}
/*glow for webkit*/
@-webkit-keyframes neon1 {
from {
text-shadow: 0 0 10px #fff,
0 0 20px #fff,
0 0 30px #fff,
0 0 40px #FF1177,
0 0 70px #FF1177,
0 0 80px #FF1177,
0 0 100px #FF1177,
0 0 150px #FF1177;
}
to {
-
JavaScript與用户端教程
一頁面輸出1.頭部文件複製代碼代碼如下:2.複製代碼代碼如下:3.外部文件4.利用頁面ID的innerHtml複製代碼代碼如下:5.警告alert("廣州百匯物流有限公司");6.詢問複製代碼代碼如下:if(confirm("是否訪問我們的首頁")){alert("是的',前往");}else{alert("退出");}...
-
針對dom元素的分析應用
如果這個DOM元素沒有樣式也就談不上操作了。2.我們也可以直接用JS動態的向html裏寫入DOM元素。今天這章我們就講這兩個應用(一)對html裏現有的DOM元素進行操作。我上面説了,對現有的DOM元素進行操作,無非就是對樣式的操作。所以我們首先就要能獲取這個DOM元素的樣...
-
如何理解Javascript的caller,callee,call,apply區別
在提到上述的概念之前,首先想説説javascript中函數的隱含參數:argumentsarguments該對象代表正在執行的函數和調用它的函數的參數。[function.]arguments[n]參數function:選項。當前正在執行的Function對象的名字。n:選項。要傳遞給Function對象的從0開始的參數值...
-
網頁設計很糟糕的10個原因
個好的網頁設計,不僅吸引眼球,也是實用的、直觀的、層級簡單卻足夠複雜到保持用户的興趣。但是不好的網頁設計是由很多原因造成的,下面是關於網頁設計很糟糕的10個原因,歡迎閲讀了解!沒有足夠的空白空白可以説是設計中最重要的一部分。它有助於防止用户在瀏覽網站時...