前端css知识点总结

多行文本溢出显示省略号

 提示: 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;
}

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值