💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、豆包、星火、月之暗面及文生图、文生视频 广告
### 给有背景的元素添加半透明边框,但不使其透过当前元素的背景,则按照一般写法即可border-color为半透明色 ``` <style> div{ width: 100px; height: 100px; background-color: red; border: 10px solid rgba(255,255,255,0.5); } <style> <div></div> ``` ### 给有背景的元素添加半透明边框,想让半透明边框透过当前元素的背景,则添加background-clip: padding-box,该属性的默认值为border-box ``` <style> div{ width: 100px; height: 100px; background-color: red; border: 10px solid rgba(255,255,255,0.5); background: padding-box; } <style> <div></div> ```