用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,
-
JavaScript数组去重的四种方法
javascript数组去重方法汇总ue1=function(){varn=[];//一个新的临时数组for(vari=0;i<th;i++)//遍历当前数组{//如果当前数组的第i已经保存进了临时数组,那么跳过,//否则把当前项push到临时数组里面if(xOf(this[i])==-1)(this[i]);}returnn;};ue2=function(){var...
-
javascript包装对象的用法
js对象是一种复合值:它是属性或已命名值得集合。参考以下代码:vars="helloworld";varlen=th;在该例子中,s是字符串,而字符串不是对象,但为何会有属性呢?其实只要引用了字符串s的属性,js就会将字符串通过调用newString(s)的方式转换为对象,该对象继承了字符串的方法,并被...
-
如何理解Javascript的caller,callee,call,apply区别
在提到上述的概念之前,首先想说说javascript中函数的隐含参数:argumentsarguments该对象代表正在执行的函数和调用它的函数的参数。[function.]arguments[n]参数function:选项。当前正在执行的Function对象的名字。n:选项。要传递给Function对象的从0开始的参数值...
-
关于HTML meat作用
meta标签用于网页的与中,meta标签的用处很多。meta的属性有两种:name和http-equiv。name属性主要用于描述网页,对应于content(网页内容),以便于搜索引擎机器人查找、分类(目前几乎所有的搜索引擎都使用网上机器人自动查找meta值来给网页分类)。这其中最重要的是descrip...