css样式实现

1、实现一个中间粗两头细的线条

在这里插入图片描述

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>样式</title>
</head>
<style>
    .main {
        border: 1px solid #38b3c4;
        height: 82px;
        width: 500px;
        border-radius: 50px;
        background: url("../images/map_yj_icon.png") no-repeat;

    }

    /* .img {
        height: 100%;
        width: 82px;
    } */

    /* .topline {
        width: 100%;
        height: 2px;
        background: linear-gradient(to right, rgba(0, 0, 0, .1) 12%, hsl(0, 98%, 54%) 50%, rgba(0, 0, 0, .1) 100%);
    } */

    .alarmBox {
        margin: 0 auto;
        position: relative;
        top: 50%;
        transform: translateY(-50%);
        /* border-top: 1px solid rgb(249 106 101);
        border-bottom: 1px solid rgb(249 106 101); */
        width: 90%;
        height: 80%;
        line-height: 35px;
        background-image: linear-gradient(to right, rgb(251 251 251 / 8%) 12%, rgb(241 222 227 / 80%) 50%, rgb(251 251 251 / 8%) 100%);
        color: rgb(255 0 0 / 90%);
        overflow: hidden;
    }

    .topline,.bottomline  {
        margin: 0 auto;
        position: relative;
        top: 10%;
        left: 25px;
        transform: translateY(-50%);
        width: 80%;
        height: 1px;
        background: linear-gradient(to right, rgb(217, 33, 13, .2) 0%, rgb(253, 23, 23) 45%, rgba(217, 33, 13, .2) 100%);
    }

    .bottomline {
        top: 12%;
    }

    .line {
        width: 100px;
        height: 2px;
        background: linear-gradient(to right, rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, .8) 50%, rgba(0, 0, 0, .1) 100%);
    }

    .linear {
        width: 100%;
        height: 2px;
        background: linear-gradient(to right,
                rgba(0, 0, 0, 0) 0%,
                rgba(0, 0, 0, 0) 10%,
                rgba(35, 198, 200, 0.3) 20%,
                rgba(35, 198, 200, 0.4) 30%,
                rgba(35, 198, 200, 0.5) 40%,
                rgba(35, 198, 200, 0.8) 50%,
                rgba(35, 198, 200, 0.5) 60%,
                rgba(35, 198, 200, 0.4) 70%,
                rgba(35, 198, 200, 0.3) 80%,
                rgba(0, 0, 0, 0) 90%,
                rgba(0, 0, 0, 0) 100%)
    }
</style>

<body>
    <div class="main">
        <!-- <div class="img">
            <img src="../images/map_yj_icon.png" alt="" srcset="">
        </div> -->
        <div class="topline"></div>
        <div class="alarmBox">


        </div>
        <div class="bottomline"></div>
    </div>
    <br>
    测试
    <div class="line"></div>
    <hr><br><br> <br> <br> <br>
    <div class="linear"></div>
</body>

</html>

2、css渐变文本

在这里插入图片描述

<style>
.demo-text {
  width: 300px;
  font-size: 48px; 
  background: linear-gradient(315deg, #42d392 25%, #647eff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
</style>
<div class="demo-text">Hello World!</div>

3、css扇形圆锥效果

在这里插入图片描述

<style>
.conic-effect {
  background: conic-gradient(rgb(255, 132, 45) 0% 25%, rgb(166, 195, 209) 25% 56%, #ffb50d  56% 100%);
  border-radius: 50%;
  width: 150px;
  height: 150px;
}
</style>  
<div class="conic-effect"></div>

4、css实现首字母大写排版效果

在这里插入图片描述

<style>
  .demo:first-letter {
    font-size: 100px;
    display: block;
    float: left;
    line-height: .5;
    margin: 15px 15px 10px 0 ;
  }
</style>  
<p class="demo">Hello world!</p>

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值