【发布时间】:2020-04-19 12:51:51
【问题描述】:
我需要仅使用 CSS3 创建这个自定义形状。
需要使用 CSS,而不是 svg。 我试图使用此链接的 sn-ps:Wave (or shape?) with border on CSS3 但我不知道如何正确操作形状。
也可以只有中心形状!我正在用这支笔测试:https://codepen.io/Blumenkranz/pen/vYEeLjr
@mixin push--auto {
margin: {
left: auto;
right: auto;
}
}
@mixin pseudo($display: block, $pos: absolute, $content: "") {
content: $content;
display: $display;
position: $pos;
}
.section {
width: 100%;
height: 50vh;
background: $blue-dark;
position:relative;
&::after, &::before {
@include pseudo;
@include push--auto;
bottom: -46px;
left: 35%;
width: 250px;
height: 150px;
background: $blue-dark;
border-radius: 100%;
}
}
【问题讨论】:
-
要绘制它,您需要绘制椭圆曲线——这是 CSS 难以解决的问题。为什么不能使用 base64 编码的 SVG 背景图片?
-
因为这对工作来说是一个挑战......我不能使用图像,只能使用 css 来绘制所有内容
-
+1 回答一个棘手的问题。我无法到达那里让我很烦恼,但this question 和the JSFiddle linked in it 可能会为您指明正确的方向。还有一些答案与您正在寻找的答案有些接近..
-
@mtr.web 我有点需要做反向边界半径......这个很简单......我需要在里面填充形状,而不是在外面......我还在尝试这里.
-
您可以尝试三个椭圆形 1. 白色(左) 2. 蓝色(中) 3. 白色(右)css-tricks.com/the-shapes-of-css 并努力将它们重叠以创建效果。不完美,但可能有效。
标签: css sass css-selectors css-shapes