Attempting to utilize SVG as an alternative to clippath due to limited cross-browser support has proven challenging. Each time I make the attempt, I face the same issue: the SVG functions properly but appears small and does not scale to fit the designated element. Despite numerous efforts, I have been unable to pinpoint the error.
<div id="container">
<div id="target">
<div id="Box_Collectors">
<div class="blackBox">
<h1>TITLE</h1>
<div>One morning, when Gregor Samsa woke from troubled dreams...
</div>
<div class="blackBox">
<h1>TITLE</h1>
<div> One morning, when Gregor Samsa woke from troubled dreams...
</div>
<div class="blackBox">
<h1>TITLE</h1>
<div>One morning, when Gregor Samsa woke from troubled dreams...
</div>
</div>
</div>
<svg xmlns="http://www.w3.org/2000/svg" width="0" height="0"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:ev="http://www.w3.org/2001/xml-events"
class="" viewBox="0 0 100 100" clipPathUnits="objectBoundingBox">
<defs>
<clipPath id="blackBox-clip">
<polygon points="100 0, 100 100, 0 100, 0 35, 15 25, 0 15, 0 0"></polygon>
</clipPath>
</defs>
</svg>
</div>
The CSS is provided below:
* { color: #fff }
.blackBox {
background: #000;
position: relative;
z-index: 100;
height: 300px;
width: 300px;
margin: auto;
padding-left: 60px;
-webkit-clip-path: url("#blackBox-clip");
clip-path: url("#blackBox-clip");
}
View the demonstration of the issue here.