CSS3 / SVG 分隔符

CSS3 / SVG Separator

我正在尝试使用 svg 或纯 css3 制作 header 分隔符,如下所示: preview from design

在 header 我有标准 bootstrap 4 个轮播

<section class="slider">
        <div id="carousel" class="carousel slide carousel-fade" data-ride="carousel">
            <div class="carousel-inner">
                <div class="carousel-item active" style="background-image:url(images/20180818_STP501.jpg);">
                    <div class="container position-relative h-100">
                        <div class="carousel-container">
                            <div class="carousel-content">
                                <h2>Consectetuer adipiscing elit,<br/>diam nibh euismod tincidunt</h2>
                                <p>Enim ad veniam, ullamcorper<br/>suscipit aliquip commodo</p>
                                <div class="mt-5">
                                    <a href="#">Euismod</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="carousel-item" style="background-image:url(images/20180818_STP501.jpg);">
                    <div class="container position-relative h-100">
                        <div class="carousel-container">
                            <div class="carousel-content">
                                <h2>Consectetuer adipiscing eli,<br/>diam nibh euismod tincidunt</h2>
                                <p>Enim ad veniam, ullamcorper<br/>suscipit aliquip commodo</p>
                                <div class="mt-5">
                                    <a href="#">Euismod</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <a class="carousel-control-prev" href="#carousel" role="button" data-slide="prev">
                <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                <span class="sr-only">Previous</span>
            </a>
            <a class="carousel-control-next" href="#carousel" role="button" data-slide="next">
                <span class="carousel-control-next-icon" aria-hidden="true"></span>
                <span class="sr-only">Next</span>
            </a>
        </div>
    </section>

Border radis 工作正常,但我需要底部的小圆形分隔符 header。它可能与 css3 一起制作?或者需要 svg 形状?

我希望这就是您要问的:在下一个示例中,我将使用 clip-path 剪辑 header。请注意,我使用的路径有一个 1/1 和 clipPathUnits="objectBoundingBox".

的边界框

MDN quote: This value indicates that all coordinates inside the element are relative to the bounding box of the element the clipping path is applied to. It means that the origin of the coordinate system is the top left corner of the object bounding box and the width and height of the object bounding box are considered to have a length of 1 unit value.

#header {
  padding: 0;
  background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/222579/castell.jpg);
  background-size: cover;
  height: 50vh;
  -webkit-clip-path: url(#clip);
  clip-path: url(#clip);  
}
<svg height="0" width="0" class="svg-clip" style="position:absolute">
    <defs>
         <clipPath id="clip" clipPathUnits="objectBoundingBox">
           <path d="M0,0L0,.5 A.6,.6 0 0 0 1,.5L1,0z" />
        </clipPath>
    </defs>
</svg>
 
<div id="header"></div>