在这里,我想只给进度条的右上方和右下方提供border-radius.我try 做的是,例如,我有3个不同 colored颜色 的进度条.让这些 colored颜色 是红色,绿色和蓝色.在红色进度条的半径给定后,绿色的 colored颜色 也应该在它后面看到.同样的,在给绿色进度条一个半径后,蓝色进度条的 colored颜色 应该在它后面继续.下面是一个图像,更清楚地解释了我的意思.

enter image description here

.customer-count-container .progress {
  box-shadow: 0px -4px 4px -2px rgba(0, 0, 0, 0.25) inset, 0px 3px 2.8px 0px rgba(255, 255, 255, 0.8) inset;
  overflow: hidden;
}

.customer-count-container .progress .progress-bar:nth-child(1),
.customer-count-container .progress .progress-bar:nth-child(2),
.customer-count-container .progress .progress-bar:nth-child(3) {
  border-bottom-right-radius: 10px;
  border-top-right-radius: 10px;
  overflow: hidden;
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">

<div class="progress" style="width: 35%; height: 10px">
  <div class="progress-bar" style="width: 20%; background-color: var(--red)"></div>
  <div class="progress-bar" style="width: 35%; background-color: var(--green)"></div>
  <div class="progress-bar" style="width: 45%; background-color: #4d7a90"></div>
</div>

推荐答案

我可能会把wine 吧累加起来.也就是说,每个条形图都会增加前一个条形图的值.然后你只需要把半径放在所有的角上.

您还需要对它们进行绝对定位,以便它们彼此重叠,并且需要颠倒它们的顺序(或者如果文档顺序很重要,则设置适当的z索引值).

请注意,阴影已被移动到伪元素,以便它可以覆盖条形图.

.progress::after {
  position: absolute;
  content: '';
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-shadow: 0px -4px 4px -2px rgba(0, 0, 0, 0.25) inset, 0px 3px 2.8px 0px rgba(255, 255, 255, 0.8) inset;
}

.progress .progress-bar {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 10px;
  overflow: hidden;
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">

<div class="progress position-relative m-2" style="width: 35%; height: 10px">
  <div class="progress-bar" style="width: 100%; background-color: #4d7a90"></div>
  <div class="progress-bar" style="width: 55%; background-color: var(--green)"></div>
  <div class="progress-bar" style="width: 20%; background-color: var(--red)"></div>
</div>

Html相关问答推荐

Rmarkdown上的垂直标签集

R中的动态Webscraping

Tailwincss:自动设置网格高度

为什么我的搜索栏会出现在WONG位置?

如何翻转卡片图像的背面

SCSS动画错误:心脏在页面刷新时启动动画,原因是:Checked和:Not(:Checked) Select 器

如何从elementor中的滑块中获取文本?

如何在VB.NET中用打印预览和直接打印的方式在Html中打印数据表的内容,包括页眉/设置纸张/方向/适合页面/总计

默认情况下使用Disbale Scroll,但在单击图标后将其激活

当底部进入视图时从底部粘性定位

为什么 CSS 网格超出了父级?

为 HTML5 文本字段设置最后六位正则表达式模式

如何使用CSS将页面标题水平居中对齐

如何在图片前面放置下拉框?

在shiny 的应用程序中使用图标功能时出错

如何将图像移动到父容器的右侧?

使用 css 将内容居中并向左对齐?

调整大小时 CSS 溢出

如何使具有两个元素的 div 行在移动设备中响应

网站页脚中的 Quarto 安装版本