美文网首页
CSS3实现一束光划过图片、和文字特效

CSS3实现一束光划过图片、和文字特效

作者: 王阿王 | 来源:发表于2017-05-03 00:15 被阅读0次
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
p{
width:15%;
margin:0 auto;
line-height:50px; 
font-size:30px; 
text-align:center;
transform-origin: 50px 50px;

transform: rotate(45deg) skew(-45deg);
/*-webkit-background-clip: text;*/ /*按文字裁剪 */
/* -webkit-text-fill-color: transparent; */ /*文字的颜色使用背景色*/ 

background-color:#C89845; /*设置一个背景色*/ 
background-image: -webkit-linear-gradient(-4deg, rgba(200,152,69,.6) 30%, #fff 50%, rgba(200,152,69, 0.6) 70%); /*设置渐变的背景,按对角线渐变*/

background-blend-mode: hard-light; /*设置背景为混合模式下的强光模式*/
background-size: 200%;

-webkit-animation: shine 2.5s infinite; /*给背景添加动画改变位置*/
}


@-webkit-keyframes shine {
from {background-position: 130%;}
to {background-position: -30%;}
}
</style>
</head>
<body><p>7折</p></body>
</html>
Paste_Image.png

另外还找了一种在图片中 光闪的效果:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
html,body{background-color:#333;}
.img { display:block; position: relative; width:800px; height:286px; margin:0 auto;overflow: hidden;}

.img:before { 
content: ""; position: absolute; width:200px; height: 100%; top: 0; left: -150px; overflow: hidden;

background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255,255,255,0)), color-stop(50%, rgba(255,255,255,.2)), color-stop(100%, rgba(255,255,255,0)));/*老式语法书写规则*/

background: -moz-linear-gradient(left, rgba(255,255,255,0)0, rgba(255,255,255,.2)50%, rgba(255,255,255,0)100%);
background: -webkit-linear-gradient(left, rgba(255,255,255,0)0, rgba(255,255,255,.2)50%, rgba(255,255,255,0)100%);
background: -o-linear-gradient(left, rgba(255,255,255,0)0, rgba(255,255,255,.2)50%, rgba(255,255,255,0)100%);

-webkit-transform: skewX(-25deg);
-moz-transform: skewX(-25deg)

}
.img:hover:before { left: 150%; transition: left 1s ease 0s; }

</style>
</head>
<body>
<a href="#" class="img">![](img/1.jpg)</a>
</body>
</html>
Paste_Image.png

相关文章

  • CSS3实现一束光划过图片、和文字特效

    另外还找了一种在图片中 光闪的效果:

  • css3实现图片划过一束光闪过效果

    .img {display:block;position:relative;width:800px;height:...

  • js特效篇---CSS3线性渐变实现图片闪光划过效果

    笔记 - CSS3线性渐变实现图片闪光划过效果 | 前端网(QDFuns) https://www.qdfuns...

  • CSS3

    一、CSS3 css:层叠样式表。 css3的组成模块:选择器盒模型背景和边框文字特效2D/3D转换动画多列布局用...

  • 2d蒙版效果

    当鼠标移入图片的时候,阴影层从左侧慢慢划过来。主要应用了css3的动画效果和定位

  • 请给我一束光,穿越时空的碎片,聚集人生喜乐。 请给我一束光,穿射生活的雾霾,驱散人生苦难。 请给我一束光,划过指缝...

  • 一张图让你快速掌握CSS3倒影

    在CSS3之前,想要实现示例图片这样的一个倒影效果一般只能通过处理图片的方式,而CSS3问世之后,想要实现这样的效...

  • 隧道

    天黑了 不 悠长隧道正是你在走的路 霎那间 一束光 一束渴望已久的光从身上划过 一束又一束 越来越快越来越快 而这...

  • CSS3(1)边框和背景

    今天看到介绍说css3被拆分为模块,最重要的模块有如下:选择器、盒模型、背景和边框、文字特效、2D/3D转换、动画...

  • css3菜鸟教程学习笔记_CSS3 边框/圆角/盒阴影

    一些最重要CSS3模块如下:选择器、盒模型、背景和边框、文字特效、2D/3D转换、动画、多列布局、用户界面。 CS...

网友评论

      本文标题:CSS3实现一束光划过图片、和文字特效

      本文链接:https://www.haomeiwen.com/subject/vdahtxtx.html