前端工程师通过CSS实现文字渐变色
source link: https://www.80shihua.com/archives/1854
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
前端工程师通过CSS实现文字渐变色
css3有很多强大的功能,比如我们经常看到的艺术字,其实可以通过css3的渐变来修改.
background: linear-gradient(to right, red, blue);
这样就是给文件添加一个渐变背景。
还有一种方法就是使用-webkit-mask,这个是给背景做遮盖,通过不同的背景显隐,来控制文字的变化。
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<style type="text/css">
position: relative;
color: yellow;
h1:before{
content: attr(text);
position: absolute;
z-index: 10;
color:pink;
-webkit-mask:linear-gradient(to left, red, transparent );
</style>
</style>
</head>
<body>
<h1 text="前端简单说">前端简单说</h1>
</body>
</html>
效果如下:
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
发表评论 取消回复
电子邮件地址不会被公开。 必填项已用*标注
Recommend
-
8
css利用border-image实现border渐变色效果更新日期: 2022-04-29阅读量: 688标签:
-
11
【Android 】TextView 局部文字变色 TextView 对于富文本效果的实现支持不支持呢?比如“局部文字颜色的变动”,“局部字体的变动” 一、需求效果...
-
4
CSS background背景图标的变色技巧 这篇文章发布于 2022年01月31日,星期一,23:47,归类于 CSS相关。 阅读 2113 次, 今日 75 次...
-
6
catalog这篇文章没有目录关注本站公众号获取最新福利
-
6
CSS 实现单行文字加载效果 2021.12.05 进击的码农 0 88 ...
-
4
css实现文字垂直展示的方法总汇更新日期: 2022-04-28阅读量: 313标签: ...
-
2
一、问题描述: 当高度固定或不固定时,单行或多行文本难以实现垂直居中; 二、解决方法: 1、使用line-height属性,将line-height设置与元素高度等高。 局限性:只适用于单行文本,局限性大。 .box {...
-
73
byzhangxinxu from https://www.zhangxinxu.com/wordpress/?p=8187 本文可全文转载,个人网站无需授权,只要保留原作者、出处以及文中链接即可,任何网站均可摘要...
-
3
游戏中角色变色如何实现? 来自知乎问题:http://www.zhihu.com/question/31133351 游戏中的惯用做法叫:调色盘色彩旋转 1. 调色盘里能变色的颜色总是固定几个位...
-
1
给 border 设置渐变色是很常见的效果,实现这个效果有很多思路,今天把我所知道的方法罗列于此供大家参考。1. 使用 border-imageCSS 提供了
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK