多行文本溢出显示省略号
提示: webpack打包后-webkit-box-orient会被移除,autoprefixer会自动移除老式过时的代码,所以需要添加注释关闭autoprefixer,但是如果有清除注释的插件,请将该插件设为false,否则不生效。
line-height: 1.4em;
height: 2.8em;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
/* autoprefixer: off */
-webkit-box-orient: vertical;
/* autoprefixer: on */
-webkit-line-clamp: 2;
CSS实现div的高度填满剩余空间
1. 最佳 min-height: 100vh;
<html lang="en">
<body>
<div class="wrap">
<div class="header"></div>
<div class="content"></div>
</div>
</body>
</html>
<style>
.wrap {
min-height: 100vh;
display: flex;
flex-direction: column;
background-color: #efefef
}
.header {
background: #067bff;
padding: 1% 2%;
}
.content {
flex: 1;
}
height: 100%;
}
</style>
2. 定位 top和bottom一起使用
#content {
background-color: #cc85d9;
width: 100%;
position: absolute;
top: 50px;
bottom: 0px;
left: 0px;
}
原生button处理
<button class="btn">提交</button>
<style>
.btn {
width: 100%;
height: 42px;
background: linear-gradient(to right, #0748A5, #006EFF);
border: none;
color: white;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
cursor: pointer;
box-sizing: border-box;
border-radius: 5px;
}
.btn:hover {
background: linear-gradient(to right, #0737A5, #0058FF);
}
</style>
内发光
box-shadow: rgb(11, 234, 235) 0px 0px 18px inset;
文字渐变
//文字渐变
.text{
background: linear-gradient(180deg, rgba(62, 48, 25, 1) 0%, rgba(109, 26, 59, 1.0) 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}