I want to have an svg image to be scaled as follows:
The right arrow (painted in red) should always scale to the height of the blue box, which can have dynamic height.
I have tried implementing it using an svg image:
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 50 100" preserveAspectRatio="xMidYMid meet">
<polygon points="0,0 50,50 0,100" style="fill:white" />
</svg>
I tried different versions of preserveAspectRatio and viewBox.
My css implementation is like
#before-main section header.section-header .header-arrow {
position:absolute;
right:0;
height:100%;
width:4.1%;
background:url("../img/headlineArrow_bg.svg") no-repeat right center;
background-size:100% 100%;
}
HTML looks like
<header class="section-header">
<div class="header-arrow">
</div>
</header>
Is there a way to implement this using the svg image as css background?
Edit: Width of The arrow should always stay the same.