css 部分文字、边框样式等

1.文字发光

        text-shadow(h-shadow,v-shadow,blur,color)
        

        用法:  text-shadow: 0 0 6px red, 0 0 20px red, 0 0 30px red, 0 0 40px red;
        添加多个阴影,效果如上,如果希望发光效果小一点多个阴影数值间隔小一点

         text-shadow: 0 0 3px #fff, 0 0 5px #fff;效果
       
 

2.文字颜色渐变

        思路:设置背景色渐变,文字颜色设置透明
        代码:

.demo {
    background: -webkit-linear-gradient(to top, rgba(255, 189, 60, 1), rgba(255, 255, 255, 1));
    background: linear-gradient(to top, rgba(255, 189, 60, 1), rgba(255, 255, 255, 1));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

效果:

3.文字描边

        效果:

.demo {
    color: #ff0000;
    text-shadow: 1px 0 rgb(83, 168, 205), -1px 0 rgb(83, 168, 205), 0 1px rgb(83, 168, 205), 0 -1px rgb(83, 168, 205), 1px 1px rgb(83, 168, 205), -1px -1px rgb(83, 168, 205), 1px -1px rgb(83, 168, 205), -1px 1px rgb(83, 168, 205);
}

4.文字间距: 

.demo {
    letter-spacing: 3px; // 字符间隙
    word-spacing:5px; // 控制单词之间的间距
}

5.边框颜色渐变
        

.demo {
    width: 100%;
    height: 230px;
    position: relative;
    z-index: 0; // 内容需要在边框背景上方
    border-radius: 10px;
    background: -webkit-linear-gradient(to top, rgba(2, 37, 79, 1), rgba(3, 21, 43, 1));
    background: linear-gradient(to top, rgba(2, 37, 79, 1), rgba(3, 21, 43, 1));
}

.demo::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    border: 1px solid transparent;
    border-radius: 10px;
    background: linear-gradient(to top, rgb(4, 95, 151), rgb(3, 39, 83)) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    border-image: linear-gradient(to top, rgb(4, 95, 151), rgb(3, 39, 83)) 1;
    z-index: -1; // 边框背景必须低于内容
}

上述方法可以设置渐变边框为圆角
效果:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

是某某吖

感谢您~ 祝您发大财~

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值