The following code shows an SVG whose height depends on the height of another element:
https://codepen.io/HermanBovens/pen/aLjBGE
HTML
<div class="root">
<div >
<div>This</div>
<div>content</div>
<div>determines</div>
<div>the</div>
<div>height</div>
<div>of</div>
<div>the</div>
<div>SVG</div>
</div>
<svg width="50px" viewBox="0 0 20 20" preserveAspectRatio = "none slice">
<!-- I want do draw a down arrow here that spans the whole height, but only the length of the line should be variable, the arrow should not scale -->
<line x1="10" y1="0" x2="10" y2="20" stroke="black" stroke-width="2"/>
<line x1="0" y1="15" x2="10" y2="20" stroke="black" stroke-width="1"/>
<line x1="20" y1="15" x2="10" y2="20" stroke="black" stroke-width="1"/>
</svg>
</div>
CSS
.root {
display: flex;
align-items: stretch;
}
svg {
background: lightblue;
}
How can the code be adapted so that the line of the arrow gets longer as the content on the left gets longer, but without the head being stretched?