CSS opacity 示例

CSS opacity1 个文件更新于 2026-04-06
html公开前 25 行,完整代码需登录
<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <title>CSS opacity 示例</title>
  <style>
    .box-wrapper {
      background-color: #e5e5e5;
      height: 170px;
      display: inline-block;
    }
    .box {
      width: 150px;
      height: 150px;
      margin: 10px;
      float: left;
      background: #2196F3;
      color: white;
      text-align: center;
      line-height: 150px;
    }
    /* 完全不透明(默认) */
    .opacity-1 { opacity: 1; }
    /* 半透明 */
    .opacity-05 { opacity: 0.5; }

登录后可以查看完整源码、在线编辑并实时预览运行效果。