Closed. This question is off-topic. It is not currently accepting answers. Learn more。
想改进这个问题吗?Update the question所以堆栈溢出的值小于aa>。
去年关门了。
我试图用SVG画一条垂直线。
on-topic
假设“x”和“x2”是相同的,我本以为这条线是完全垂直的。我对这种类型的编程很陌生,所以我可能遗漏了一些非常明显的东西,但是这不是我所期望的行为。
如何使这条线垂直?
想改进这个问题吗?Update the question所以堆栈溢出的值小于aa>。
去年关门了。
我试图用SVG画一条垂直线。
<style>
svg#chart {
background: lightgray;
}
#chart line {stroke: #555555; stroke-width:1}
</style>
<svg id="chart" width="300" height="225">
<line x="20" y1="20" x2="20" y2="130"></line>
</svg>
on-topic
假设“x”和“x2”是相同的,我本以为这条线是完全垂直的。我对这种类型的编程很陌生,所以我可能遗漏了一些非常明显的东西,但是这不是我所期望的行为。
如何使这条线垂直?
最佳答案
你想要的是x1,不是x
<style>
svg#chart {
background: lightgray;
}
#chart line {stroke: #555555; stroke-width:1}
</style>
<svg id="chart" width="300" height="225">
<line x1="20" y1="20" x2="20" y2="130"></line>
</svg>
关于html - 如何在SVG中绘制垂直线,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/40179077/