早期無 border-radius 時,用多層 <b> 或 <p> 疊加 1px 高、邊距遞減的色塊模擬圓角。原始碼冗長、維護困難,**已淘汰**,僅供考古參考。
.rounded-box {
border-radius: 8px; /* 四角同半徑 */
/* 或分別指定 */
border-radius: 8px 4px 12px 0; /* 左上、右上、右下、左下 */
/* 橢圓角 */
border-radius: 50% / 20%; /* 水平半徑 50%、垂直半徑 20% */
}
<!DOCTYPE html>
<html><head><meta charset="utf-8"><title>CSS3 圓角卡片</title>
<style>
.card {
width:320px; margin:2rem auto; padding:1.5rem;
background:#fff; border-radius:12px;
box-shadow:0 4px 12px rgba(0,0,0,.1);
font:16px/1.5 "Microsoft JhengHei", sans-serif;
}
.card h3 { margin-top:0; color:#1976d2; }
.card p { color:#333; }
</style></head><body>
<div class="card">
<h3>圓角卡片標題</h3>
<p>使用 border-radius 單行即可實現完美圓角,無需切圖、無需巢狀標籤,支援所有現代瀏覽器 (IE9+)。</p>
</div>
</body></html>
behavior:url(PIE.htc) 讓 IE6-8 支援 border-radius、box-shadow、linear-gradient。.octagon {
width:100px; height:100px; background:#2196f3;
clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
}
clip-path 可任意裁切形狀,支援度較 border-radius 略低 (IE 不支援),但可作為漸進增強。