萬盛學電腦網

您现在的位置: 萬盛學電腦網 >> 程式設計 >  >> 網頁製作 >> Div CSS 教學

16 款經典 CSS 表格/資訊框樣式集:配色方案與代碼直接拿走

使用說明

以下 16 組樣式類別 .style1 ~ .style16,寬度固定 800px,高度 100px,置中並帶底部間距。可直接套用於 <div>、<table> 或任何區塊元素,適合公告欄、資訊卡片、統計面板等場景。

樣式代碼總表

類別邊框色背景色視覺風格備註
.style1#96C2F1#EFF7FF淡藍清新科技/資訊感
.style2#9BDF70#F0FBEB嫩綠自然健康/生態主題
.style3#BBE1F1#EEFAFF天藍通透輕量資訊框
.style4#CCEFF5#FAFCFD極淡青白極簡風格
.style5#FFCC00#FFFFF7警示黃/溫暖提醒/公告
.style6#92B0DD#FFFFFF藍灰專業含 h5 標題列樣式
.style7#A9C9E2#E8F5FE淡藍層次資訊密度高
.style8#E3E197#FFFFDD奶黃柔和溫馨提示
.style9#ADCD3C#F2FDDB草綠活力成功/完成狀態
.style10#F8B3D0#FFF5FA粉紅柔美女性/生活類
.style11#D3D3D3#F7F7F7中性灰通用/次要資訊
.style12#BFD1EB#F3FAFF淡紫藍知識/文檔風
.style13#FFDD99#FFF9ED米黃溫潤傳統/文化感
.style14#CACAFF#F7F7FF淡紫夢幻創意/設計類
.style15#A5B6C8#EEF3F7藍灰穩重企業/後台風
.style16#CEE3E9#F1F7F9青灰清爽數據/儀表板

完整 CSS 代碼(可直接複製)

.style1  { width:800px; height:100px; margin:0 auto 20px; border:1px solid #96C2F1; background:#EFF7FF; }
.style2  { width:800px; height:100px; margin:0 auto 20px; border:1px solid #9BDF70; background:#F0FBEB; }
.style3  { width:800px; height:100px; margin:0 auto 20px; border:1px solid #BBE1F1; background:#EEFAFF; }
.style4  { width:800px; height:100px; margin:0 auto 20px; border:1px solid #CCEFF5; background:#FAFCFD; }
.style5  { width:800px; height:100px; margin:0 auto 20px; border:1px solid #FFCC00; background:#FFFFF7; }
.style6  { width:800px; height:100px; margin:0 auto 20px; border:1px solid #92B0DD; background:#FFFFFF; }
.style6 h5 { margin:1px; background:#E2EAF8; height:24px; }
.style7  { width:800px; height:100px; margin:0 auto 20px; border:1px solid #A9C9E2; background:#E8F5FE; }
.style8  { width:800px; height:100px; margin:0 auto 20px; border:1px solid #E3E197; background:#FFFFDD; }
.style9  { width:800px; height:100px; margin:0 auto 20px; border:1px solid #ADCD3C; background:#F2FDDB; }
.style10 { width:800px; height:100px; margin:0 auto 20px; border:1px solid #F8B3D0; background:#FFF5FA; }
.style11 { width:800px; height:100px; margin:0 auto 20px; border:1px solid #D3D3D3; background:#F7F7F7; }
.style12 { width:800px; height:100px; margin:0 auto 20px; border:1px solid #BFD1EB; background:#F3FAFF; }
.style13 { width:800px; height:100px; margin:0 auto 20px; border:1px solid #FFDD99; background:#FFF9ED; }
.style14 { width:800px; height:100px; margin:0 auto 20px; border:1px solid #CACAFF; background:#F7F7FF; }
.style15 { width:800px; height:100px; margin:0 auto 20px; border:1px solid #A5B6C8; background:#EEF3F7; }
.style16 { width:800px; height:100px; margin:0 auto 20px; border:1px solid #CEE3E9; background:#F1F7F9; }

HTML 引用範例

<div class="style1"><h5><a href="/">公告標題 1</a></h5></div>
<div class="style2">純內容區塊,無標題列</div>
<div class="style6"><h5>帶標題列的統計面板</h5><p>數據內容...</p></div>
<div class="style9">成功狀態提示框</div>

擴展建議

  • 將固定 width:800px 改為 max-width:100%; width:100%; box-sizing:border-box; 適應響應式佈局。
  • 用 CSS 變數管理主色系::root { --primary-border: #96C2F1; --primary-bg: #EFF7FF; }
  • 搭配 border-radius: 4px、box-shadow: 0 2px 4px rgba(0,0,0,.08) 現代化視覺。
  • 語意化:改用 .info-box, .success-box, .warning-box 等語意類別名。
copyright © 萬盛學電腦網 all rights reserved