【问题标题】:align both top and bottom svg text vertical对齐顶部和底部 svg 文本垂直
【发布时间】:2016-06-09 23:18:29
【问题描述】:

我有一段svg写的如下:

你能告诉我如何对齐顶部和底部的内容吗 它看起来像这样:

【问题讨论】:

  • 您的标记在问题中应该是文本,而不是图像。

标签: svg vertical-alignment


【解决方案1】:

这里是: 就做, 字形方向垂直:90

<!DOCTYPE html>
    <html>
    <head>
        <title></title>
    </head>
    <body>
    <svg height="800" width="100%">
        <text x="500" y="50" font-size="22" text-anchor="inherit" style="writing-mode:tb; glyph-orientation-vertical:90">
            asdsd sdasadsa sad sad sadas sad
        </text> 

        <text x="470" y="50" font-size="22" text-anchor="inherit" style="writing-mode:tb; glyph-orientation-vertical:90">
            asdsd sdasadsa sad sad sadas sad
        </text> 

        <text x="440" y="50" font-size="22" text-anchor="inherit" style="writing-mode:tb; glyph-orientation-vertical:90">
            asdsd sdasadsa sad sad sadas sad
        </text> 

        <text x="410" y="50" font-size="22" text-anchor="inherit" style="writing-mode:tb; glyph-orientation-vertical:90">
            asdsd sdasadsa sad sad sadas sad
        </text> 

        <text x="380" y="50" font-size="22" text-anchor="inherit" style="writing-mode:tb; glyph-orientation-vertical:90">
            asdsd sdasadsa sad sad sadas sad
        </text> 

        <text x="350" y="50" font-size="22" text-anchor="inherit" style="writing-mode:tb; glyph-orientation-vertical:90">
            asdsd sdasadsa sad sad sadas sad
        </text> 
        

    </svg>

    </body>
    </html>

【讨论】:

  • 感谢您的回答,但我想对齐上边距和下边距
猜你喜欢
  • 2015-10-18
  • 2012-08-13
  • 1970-01-01
  • 1970-01-01
  • 2021-11-03
  • 2010-10-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多