First of all, I know well that this does not directly answer the question, but in the comments he said that they are interested in a non-SVG solution, and for the reasons explained later in the message, this is a much better way to solve this problem.
section { background: url('http://i.imgur.com/k8BtMvj.jpg'); background-size: cover; height: 200px; position: relative; width: 600px; } section:after { border-color: transparent #2a80b9; border-style: solid; border-width: 90px 300px 0; content: ''; height: 10px; position: absolute; bottom: 0; }
<section></section>
This solution works by absolutely placing the element at the end of each section, superimposing it and visualizing the necessary shapes using borders - by providing the upper border with a transparent color.
This has the following qualities compared to the SVG solution:
- there is no need for additional markup in each section due to the universal application of the rule
- it also means that itβs easier for you to maintain, because you donβt have to go through several html files looking for stray SVGs (this is why the style should go in CSS, and not markup in the first place).
- Changing the shape of an SVG requires changing a few values, while you only need to change one CSS value for everything you want to do. CSS rules are also much more readable than multi-line SVG anchor points (this can be subjective).
TheThirdMan
source share