1.文字镂空:
-webkit-text-fill-color:transparent;
-webkit-text-stroke:1px #000;
2.文字强制换行:
word-break: break-all;
3.保留换行符。
// css保留空格和换行符
white-space: pre-wrap;
// css保留换行符
white-space: pre-line;
4.图片变灰色
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: grayscale(100%);
filter: gray;
opacity:0.7;
5.inp修改提示字的颜色
input::-webkit-input-placeholder {
color: red;
}
6.文字渐变色:
①
p{
background-image: linear-gradient(135deg,red,blue);
-webkit-background-clip:text;
color: transparent;
}
②
<span text='房屋租赁到期提醒'>房屋租赁到期提醒</span>
span{
position: relative;
color:#ffd901;
}
span:before{
content: attr(text);
position: absolute;
z-index: 10;
color:#ffff00;
-webkit-mask:linear-gradient(to left, #ffff00, transparent );
}
7.设置背景图固定在底部,不会跟随滚动条的变化而滚动
background-attachment: fixed;
background-image: url('图片路径');
background-repeat: no-repeat;
background-attachment: fixed;
background-size: 100% 50%;
background-position: bottom;
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/96060.html