相关疑难解决方法(0)

保留 SVG 文本的纵横比

这是/sf/ask/2037358431/的编辑副本,我将其删除,因为它要求 2相关但技术上不同的问题。

正如我在上一个问题中已经解释的那样,我正在尝试制作一个带有 4 个按钮的导航 div,一个向左走,一个向右走,另一个向下走,另一个向上走。另外,中间需要一个确定按钮。

这与此处给出的解释非常有效:使用 CSS 和 HTML5 使用梯形创建导航按钮

我创建了像这样的 SVG:

<div class="function height3x svg-container" style="height: 112px; width: 200px;">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" id="mySVG" width="100%" height="100%" viewBox="0 0 100 100" preserveAspectRatio="none" style="background-color: whitesmoke">
    <g class="function" id="keyboard_btn_24">
        <polygon id="ok" points="25,25 75,25 75,75 25,75"></polygon>
        <text id="ok_text" x="39" y="55">OK</text>
    </g>
    <g class="function" id="keyboard_btn_25">
        <polygon id="up" stroke="black" stroke-width="0.1" points="0,0 100,0 65,35 35,35"></polygon>
        <text x="42" y="20">?</text>
    </g>
    <g class="function" id="keyboard_btn_26">
        <polygon id="right" stroke="black" stroke-width="0.1" points="100,0 100,100 65,65 65,35"></polygon>
        <text x="81" y="53">?</text> …
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery svg

8
推荐指数
2
解决办法
4383
查看次数

标签 统计

css ×1

html ×1

javascript ×1

jquery ×1

svg ×1