SVG和HTML5 Canvas有什么区别?他们似乎都对我这样做.基本上,他们都使用坐标点绘制矢量图稿.
我错过了什么?SVG和HTML5 Canvas有哪些主要区别?我为什么要选择一个而不是另一个?

我试图在CSS中重新制作闪电符号(DC Comics)(或Big Bang Theory的Sheldon Cooper 所穿的T恤).
这将像星级评级系统,只是一个"闪电评级系统".
但是,因为我试图将HTML保持在最低限度,所以我只想在CSS中设置这个样式.
我到了以下阶段:
html,
body {
margin: 0;
height: 100%;
background: radial-gradient(ellipse at center, rgba(79, 79, 79, 1) 0%, rgba(34, 34, 34, 1) 100%);
}
.wrap {
height: 50vw;
width: 50vw;
position: relative;
margin: 0 auto;
}
.circ:hover{
background:gray;
}
.circ:hover .bolt{
background:gold;
}
.circ {
height: 50%;
width: 50%;
background: white;
border: 5px solid black;
border-radius: 50%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
box-shadow:0 0 10px 2px black; …Run Code Online (Sandbox Code Playgroud)我目前正试图生成一个"波浪幽灵般的底部"形状.此形状包含两条双曲线:

虽然这个图像的底部部分我认为它描绘的是更好的图像.
我的守则
我当前尝试生成此形状是使用伪元素overflow: hidden,虽然这不允许渐变背景(需要简单的背景):
尝试1 - 使用隐藏溢出的伪元素
.bottom {
height: 300px;
width: 300px;
background: lightgray;
position: relative;
overflow: hidden;
margin-top:-150px;
-webkit-transform:rotate(45deg);
transform:rotate(45deg);
}
.bottom:before, .bottom:after{
position: absolute;
content: "";
background: white;
}
.bottom:before {
height: 150%;
width: 150%;
top: 50%;
border-radius:50%;
left: -45%;
}
.bottom:after {
height: 200%;
width: 100%;
bottom: -40%;
border-radius:50%;
left: 90%;
}Run Code Online (Sandbox Code Playgroud)
<div class="bottom"></div>Run Code Online (Sandbox Code Playgroud)
尝试2 - 使用具有's'形状的伪元素
.bottom {
background: lightgray;
width: 300px;
height: 300px;
position: relative;
overflow:hidden;
color:white;
border-radius:0 100% …Run Code Online (Sandbox Code Playgroud)我在SVG中有一个国家的详细地图,在这种格式的区域中分开:
<path class="state-x-area"
d="m 575.8672,180.4954 c -0.6572,-0.0938 -2.252,-0.4688 -2.627,-0.375 -1.0313,0.1875 0.375,1.501 -0.1875,1.876 -0.4688,0.1875 -1.0313,-0.0938 -1.501,0.0938 -0.1875,0.0938 0.0938,0.4688 -0.0938,0.6572 -0.9375,0.75 -2.4385,0.8438 -3.377,1.6875 -1.125,1.0322 2.0635,3.6582 0.6572,4.6904 -3.2832,2.3447 -1.2197,-1.5947 -3.377,1.501 -0.2813,0.375 0.8438,0.4688 1.0313,0.9375 0.1875,0.376 -0.9375,0.2822 -0.9375,0.6572 0,0.1875 0.9375,1.4072 0.5625,1.876 -1.0313,1.0313 -2.5322,-0.5635 -3.4707,-0.5635 -1.4063,0 1.3135,1.3135 -1.0313,0.6572 -0.6572,-0.1875 -1.501,-1.2197 -1.7822,-1.7822 -0.1875,-0.1875 -0.376,-0.751 -0.4697,-0.5625 -0.375,0.5625 -0.2813,1.2188 -0.6563,1.6875 -1.2188,1.5947 -2.9082,0 -4.3145,0.4697 -0.1875,0.0938 0.1875,0.4688 0,0.6563 -0.8447,0.4688 -2.5332,0.375 -3.377,0 0,0 0,-0.0938 0.0938,-0.0938 0.4688,-0.4688 1.0313,-0.9375 1.2197,-1.4072 3.2822,0.1875 -0.4697,-2.0635 -1.4072,-2.626 -0.6563,-0.375 0.375,-1.5947 0.1875,-2.0635 -0.1875,-0.4697 -1.6885,0.8438 -1.3135,-0.376 0.2813,-0.8438 2.0635,-1.5938 1.4072,-2.1572 -0.4688,-0.375 -2.627,-0.1875 …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用CSS制作鸡蛋风格的图像,但我做得不太正确。我想使鸡蛋顶部更窄一些。
.egg {
width: 136px;
height: 190px;
background: #ffc000;
display: block;
-webkit-border-radius: 63px 63px 63px 63px / 108px 108px 72px 72px;
border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}Run Code Online (Sandbox Code Playgroud)
<div class="egg"></div> Run Code Online (Sandbox Code Playgroud)
我希望鸡蛋显示如下图所示,但似乎无法正确调整边框半径!