在做工厂设备实时监视的时候,经常会根据设备启停,设置状态为绿色小点和红色小点:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body> <div> 方法1: <i style="width:20px;height:20px;border-radius:50%;background-color:red;display: block"></i> </div> <div> 方法2: <div style="width:20px;height:20px;border-radius:50%;background-color:red;"></div> </div> </body> </html>
效果如下:
原文地址:https://www.cnblogs.com/xianfengzhike/p/9461955.html
时间: 2024-10-09 08:42:50