<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程</title>
<style>
div#div2
{
display: inline-block;
color: transparent;
-webkit-background-clip: text;
background-clip: text;
background-image: linear-gradient(90deg,#2ca2b4,#5598de 24%,#7f87ff 45%,#f65aad76%,#ec3d43);
will-change: transform;
padding-top: .5px;
overflow: hidden;
background-color: #2ca2b4 0%;
margin-top: 14px;
}
</style>
</head>
<body>
<div id="div2">这就是你要的颜色渐变吗。</div>
</body>
</html>
css文字渐变色
于 2022-09-13 13:26:32 首次发布