css - CSS 中的圆弧边框

标签 css

我正在尝试在 div/panel 的右边界制作弧形,请告诉我是否有任何方法可以做到这一点。附件是模型的快照。 enter image description here

最佳答案

您可以在 CSS 中达到这种效果。示例如下。

.wrap {
  position: relative;
  width: 100px;
  height: 400px;
  background-color: pink;
  overflow: hidden;
}

.wrap::before {
  content:'';
  width: 300px;
  height: 600px;
  position: absolute;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  margin-top: -300px;
  margin-left:-280px;
  background-color: tomato;
}

.wrap::after {
  content:'';
  width: 300px;
  height: 600px;
  position: absolute;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  margin-top: -280px;
  margin-left:-290px;
  background-color: white;
}
<div class="wrap">
</div>

关于css - CSS 中的圆弧边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42712500/

相关文章:

javascript - 这是滚动全景 HTML 的正确实现吗

javascript - 当我将鼠标悬停在 ChartJS 条形图中的条形上时,如何将光标更改为指针?

php - 垂直旋转文本的浏览器回退

html - Bootstrap 面板和列表未显示

css - 为什么高度 : 0 hide my padded <div>, 即使 box-sizing : border-box?

javascript - 更改 CheckBoxList 元素样式

css - 带有 AngularJS 加载栏的不可点击背景

html - 具有多行的列的 CSS 对齐方式

css - 在使用窗口生成器定位文本框和其他 gwt 小部件后,我们如何使用 css 定位它们

jquery - 在整个网站上弹出 Div? (在第一个页面加载时)