css 实现wifi,gprs 信号

本文介绍了一种使用HTML和CSS实现Wi-Fi信号强度指示图标及GPRS信号条的设计方案。通过调整div元素的位置和尺寸,可以直观地展示不同强度的信号表现。适用于前端开发人员快速实现信号图标。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、wifi信号实现

        <div class="box">
          <div class="wifi-symbol">
            <div class="wifi-circle first"></div>
            <div class="wifi-circle second"></div>
            <div class="wifi-circle third"></div>
            <div class="wifi-circle fourth"></div>
          </div>
        </div>

css 样式

.box {
  position: relative;
  width: 240px;
  height: 240px;
}
.wifi-symbol {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
  transform: rotate(45deg);
  position: absolute;
  top: -30%;
}
.wifi-circle {
  border: 20px solid #ccc;// 根据box高度宽度设置 border宽度,根据几个信号改变border颜色
  border-radius: 50%;
  position: absolute;
}
.first {
  width: 140%;
  height: 140%;
  top: 30%;
  left: 30%;
}
.second {
  width: 100%;
  height: 100%;
  top: 50%;
  left: 50%;
}
.third {
  width: 60%;
  height: 60%;
  top: 70%;
  left: 70%;
}
.fourth {
  width: 15%;
  height: 15%;
  top: 90%;
  left: 90%;
}

2、gprs信号

      <ul class="gprs">
        <li
          style="height: 0.4rem"
          class="bg-gray"
        ></li>
        <li
          style="height: 0.7rem"
          class="bg-gray"
        ></li>
        <li
          style="height: 1rem"
          class="bg-gray"
        ></li>
        <li
          style="height: 1.3rem"
          class="bg-gray"
        ></li>
      </ul>

css样式

.gprs {
  height: 1.5rem;
  width: 2rem;
  line-height: 1.5rem;
  display: flex;
  align-items: end;
  margin: 0;
  list-style: none;
}
.gprs > li {
    width: 4px;
    margin-left: 0.2rem;
    border-radius: 5px;
  }
.bg-gray {
    background-color: #8799a3;
}

.bg-green {
    background-color: #39b54a;
}

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

少十步

你的鼓励将是我创作的最大动力

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

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

打赏作者

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

抵扣说明:

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

余额充值