Please help. I need to position an svg inside a div, next to a headline. It's a rectangle, kind of a corporate design element. Code:
<div id="container">
<h1>HEADLINE</h1>
<img src="/my/rectangle.svg">
</div>
It should look like:
HEADLINE ▮
But in the case of
WRAPPED
HEADLINE
the rectangle should scale up, stretching over two lines, keeping its aspect ratio.
So my problem is:
I can't set the height of #container, because I don't know how many lines of text will be in it. When I do as suggested here, meaning say
#container {position:relative}
#container img {position:absolute; height:100%}
the svg will stretch to the right size, but it will overlap with the headline. Any ideas? Thanks!
Edit: Maybe this has nothing to do with svg. Could be any child element that needs to be scaled to parent width. The challenge is that one aspect of the problem requires it to be relative, and the other one requires it to be absolute.