用CSS3制作炫酷的自定义发光文字
来源:才华咖 本文已影响2.08W人
来源:才华咖 本文已影响2.08W人
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,
jQuery css方法动态修改CSS属性
PhotoShop制作简单的炫光残破文字效果的教程
网页游戏开发语言AS3(ActiveScript3.0)简介
炫酷的“我”作文
C语言中Static和Const关键字的作用
使用CSS3创建卓越的网站设计
css3实现地球自转代码图文教程
ps怎么设计一款独特的彩色炫光字体
超拽高冷炫酷的心情签名
英语文章赏析财富是成功的标志Wealth is a Sign of Success
CSS3导航条和毛玻璃效果制作方法
p+css的15个css重则
AE制作酷炫的闪烁抖动文字动画制作教程
用PS制作流光字的教程
基于css3的属性transition制作菜单导航效果
利用Photoshop CS3制作图层蒙板动画
JavaScript中的style.cssText使用教程分解
如何轻松制作炫酷的游戏特效
C语言中字符串常用函数strcat与strcpy的用法
CSS3属性box-shadow使用详细步骤教程
超级酷炫公主班读后感
CSS制作教程
英语success的中文是什么意思
有关PHP字符串比较函数strcmp()和strcasecmp()使用总结
CSS 各种定位(position)方式的区别