一、水平条纹效果:
<html>
<head>
<style type="text/css">
div
{
font-size:100px;
text-align:center;
line-height:3;
color:white;
background: linear-gradient(#fb3 50%,#58a 50%);
background-size:100% 100px;
}
</style>
</head>
<body>
<div>测试一下</div>
</body>
</html>
效果图:
二、垂直条纹效果:
<html>
<head>
<style type="text/css">
div
{
font-size:100px;
text-align:center;
line-height:3;
color:white;
background: linear-gradient(to right,#fb3 50%,#58a 50%);
background-size:100px 100% ;
}
</style>
</head>
<body>
<div>测试一下</div>
</body>
</html>
效果图: