完整代码示例 html
DESIGN
/* CSS部分 */ .banner { background: linear-gradient(45deg,本镂 #ff6b6b, #4ecdc4); padding: 2rem; text-align: center; } .hollow-text { font-size: 5rem; font-weight: bold; -webkit-text-fill-color: transparent; -webkit-background-clip: text; background: white; /* 实际会被父元素背景覆盖 */ } 实际应用技巧 动态背景增强效果:若父元素使用视频或动画背景
, 边框镂空