gpt4 book ai didi

html - 纯 CSS 圆形丝带

转载 作者:太空宇宙 更新时间:2023-11-04 13:54:07 24 4
gpt4 key购买 nike

我正在尝试使用纯 CSS 实现以下目标,这可能吗?如果我能想出一种方法将底部隐藏到底部圆 Angular 的顶部,那将是可行的。但是我不知道什么会起作用......

Designers Design what I have thus far

.ribbon, .ribbon * {
box-sizing: border-box;
-moz-box-sizing: border-box;
}
.ribbon {
width: 600px;
margin: 40px auto 10px;
padding: 0 10px 4px;
position: relative;
color: black;
background: #eee;
}
.ribbon h3 {
display: block;
height: 40px;
width: 620px;
margin: 0;
padding: 5px 10px 5px 30px;
position: relative;
left: -30px;
color: white;
background: rgb(193,0,0);
box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.ribbon h3::before {
content: '';
display: block;
width: 0;
height: 0;
position: absolute;
bottom: -11px;
z-index: 10;
left: 0;
}
.ribbon.round h3 {
border-radius: 10px 0px 0px 0px;
}
.ribbon.round h3::before {
width: 20px;
height: 30px;
bottom: -20px;
border: none;
background: rgb(61,0,0);
border-radius: 10px 0px 0px 10px;
}

摆弄我目前拥有的东西 http://jsfiddle.net/yoderman94/Gdgwq/

最佳答案

简单地让你的 z-index 值为负数:

.ribbon h3::before {
z-index: -1;
}

这会将它放在标题下。

要保持圆形顶部,添加另一个具有较低 z-index 的 block ,并使用与标题相同的背景填充它:

示例:http://jsfiddle.net/K7e96/

关于html - 纯 CSS 圆形丝带,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19546201/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com