使 SVG 元素从 100% 高度图像的底部垂直对齐

Make an SVG element vertical align from a bottom of a 100% height image

我将 SVG 响应文本叠加在 100% 高度的图像上。图像拉伸了用户浏览器的全屏高度。

但是我需要将 SVG 文本垂直对齐到左下角而不是 100% 高度图像的左上角。

我已经尝试过使用 CSS 可以实现的相对和绝对定位,但是当我使用 SVG 实现时,我的文字消失了。

#header {
  position: relative;
  min-height: 150px;
}

#header-content {
  position: absolute;
  bottom: 0;
  left: 0;
}

这是我的 html:

<html>

<body>

  <div class="img-overlay-wrap">
    <img src="https://i2.wp.com/www.joelonsoftware.com/wp-content/uploads/2016/12/Pong.png" alt="null" style="width: 100%;max-width: 100%!important;height:100%">
    <svg viewBox="0 0 1200 800">
    <style>
      .b-on-w{
        text-anchor: start;
        fill:#000000;
        font-family:Helvetica, arial, sans-serif;
        /*background-color:#ffffff;*/
        display: inline;
        letter-spacing:7px;
        font-size:78px;
      }

      .w-on-b{
        text-anchor: start;
        fill:#ffffff;
        font-size:40px;
        font-weight:1600;
        font-family:Helvetica, arial, sans-serif;
        /*background-color:#000000;*/
        display: inline;
        letter-spacing:7px;
        font-size:18px;
      }

      .img-overlay-wrap {
        width:100%;
        heigh:100%;
        position: relative;
        display: inline-block; 

      }

      .img-overlay-wrap img { /* <= optional, for responsiveness */
        display: block;
        max-width: 100%;
        height: auto;
      }

      .img-overlay-wrap svg {
        position: absolute;
        top: 0;
        left: 0;
      }
    </style>

    <defs>
      <filter x="-0.03" y="-0.3" width="1.06" height="1.6" id="solid-black">
        <feFlood flood-color="black"/>
        <feComposite in="SourceGraphic" operator="over" />
      </filter>
      <filter x="-0.03" y="-0.04" width="1.06" height="1.08" id="solid-white">
        <feFlood flood-color="white"/>
        <feComposite in="SourceGraphic" operator="over" />
      </filter>
    </defs>
    
    <text filter="url(#solid-black)" x="25" y="100" class="w-on-b">I NEED TO GET AN ANSWER</text>
    <text filter="url(#solid-black)" x="25" y="140" class="w-on-b">FROM Whosebug</text>
    <text filter="url(#solid-black)" x="25" y="180" class="w-on-b">FOR AN SVG</text>
    <text filter="url(#solid-black)" x="25" y="220" class="w-on-b">ISSUE</text>
    <text filter="url(#solid-black)" x="65" y="260" class="w-on-b" style="font-weight:bold;">   &#45; ANOTHER DEV</text>
    <text filter="url(#solid-white)" x="30" y="400" class="b-on-w">QUESTION</text>
    <text filter="url(#solid-white)" x="30" y="500" class="b-on-w">POSTED</text>
    <text filter="url(#solid-white)" x="30" y="600" class="b-on-w">ON 23 JUNE</text>
    <text filter="url(#solid-white)" x="30" y="700" class="b-on-w">2020 </text>
  </svg>
  </div>
</body>

</html>

它似乎消失了,因为它需要有一个明确的'width'和'height',否则它的大小将是'0, ​​0'。我在这里做了一些修改:

.b-on-w {
  text-anchor: start;
  fill: #000000;
  font-family: Helvetica, arial, sans-serif;
  /*background-color:#ffffff;*/
  display: inline;
  letter-spacing: 7px;
  font-size: 78px;
}

.w-on-b {
  text-anchor: start;
  fill: #ffffff;
  font-size: 40px;
  font-weight: 1600;
  font-family: Helvetica, arial, sans-serif;
  /*background-color:#000000;*/
  display: inline;
  letter-spacing: 7px;
  font-size: 18px;
}

.img-overlay-wrap {
  position: relative;
}

.img-overlay-wrap img {
  max-width: 100%;
  height: auto;
}

.img-overlay-wrap svg {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: content;
}
<html>

<body>
  <div class="img-overlay-wrap">
    <img src="https://i2.wp.com/www.joelonsoftware.com/wp-content/uploads/2016/12/Pong.png" alt="null" style="width: 100%;max-width: 100%!important;height:100%">
    <svg viewBox="0 0 1200 800">
        <defs>
          <filter x="-0.03" y="-0.3" width="1.06" height="1.6" id="solid-black">
            <feFlood flood-color="black" />
            <feComposite in="SourceGraphic" operator="over" />
          </filter>
          <filter x="-0.03" y="-0.04" width="1.06" height="1.08" id="solid-white">
            <feFlood flood-color="white" />
            <feComposite in="SourceGraphic" operator="over" />
          </filter>
        </defs>
        <text filter="url(#solid-black)" x="25" y="100" class="w-on-b">I NEED TO GET AN ANSWER</text>
        <text filter="url(#solid-black)" x="25" y="140" class="w-on-b">FROM Whosebug</text>
        <text filter="url(#solid-black)" x="25" y="180" class="w-on-b">FOR AN SVG</text>
        <text filter="url(#solid-black)" x="25" y="220" class="w-on-b">ISSUE</text>
        <text filter="url(#solid-black)" x="65" y="260" class="w-on-b" style="font-weight:bold;"> &#45; ANOTHER DEV</text>
        <text filter="url(#solid-white)" x="30" y="400" class="b-on-w">QUESTION</text>
        <text filter="url(#solid-white)" x="30" y="500" class="b-on-w">POSTED</text>
        <text filter="url(#solid-white)" x="30" y="600" class="b-on-w">ON 23 JUNE</text>
        <text filter="url(#solid-white)" x="30" y="700" class="b-on-w">2020 </text>
      </svg>
  </div>
</body>

</html>