CSS background-color示例

CSS background-color1 个文件更新于 2026-04-06
html公开前 25 行,完整代码需登录
<!DOCTYPE html>
<html>
  <head>
    <style>
      .bgColor-box {
        width: 100%;
        height: 300px;
        border: 1px solid #aaa;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        color: #222;
        margin-bottom: 5px;
      }
      .bgColor-1 {
        background-color: #2196F3;
      }
      .bgColor-2 {
        background-color: rgba(52,152,219,0.5);
      }
    </style>
  </head>
  <body>
    <div class="bgColor-box bgColor-1">纯色背景</div>

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