去除scroll滚动条
1.小程序
class::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
2.网页
class::-webkit-scrollbar {
display: none;
textarea placeholder 居中
.address_text {
height: 0.6rem;
}
.address_text::-webkit-input-placeholder {
height: 0.6rem;
line-height: 0.6rem;
}
3.字体渐变色
https://blog.youkuaiyun.com/dx18520548758/article/details/81081420
1
<head>
<meta charset="utf-8">
<style>
span {
background: linear-gradient(to right, red, blue);
-webkit-background-clip: text;
color: transparent;
}
</style>
</head>
<body>
<span>前端简单说</span>
</body>
2
<head>
<meta charset="UTF-8" />
<style type="text/css">
h1{
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>
3.设置input=number 的输入长度
<input type="number" name="example" ominput="if(value.length>5)value=value.slice(0,5)">