为什么HTML/SVG坐标0,0从左上角开始?

编程入门 行业动态 更新时间:2024-10-24 22:22:07
本文介绍了为什么HTML/SVG坐标0,0从左上角开始?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

仅想知道HTML/SVG在浏览器中将0,0表示为左上角是什么原因?有什么好处吗?

与传统观点(经典几何学)相反,Y值在屏幕上越低,其值就越大.

解决方案

因为早于SVG的CSS的工作原理.

在大多数情况下,例如独立的SVG文档或嵌入(通过引用或内联)在XML父文档中的SVG文档片段,其中父文档的布局由CSS [CSS2]或XSL [XSL]确定,初始视口坐标系(因此也就是初始用户坐标系)的原点位于视口的顶部/左侧,正x轴指向右侧,正y轴指向下方,

Just wondering whats the reasoning behind saying 0,0 as top left corner in browser by both HTML/SVG? Are there any advantage to this?

It goes against conventional wisdom (classic geometry) that the Y values become greater in value the lower they are on the screen.

解决方案

Because that's how CSS which predates SVG works.

In most cases, such as stand-alone SVG documents or SVG document fragments embedded (by reference or inline) within XML parent documents where the parent's layout is determined by CSS [CSS2] or XSL [XSL], the initial viewport coordinate system (and therefore the initial user coordinate system) has its origin at the top/left of the viewport, with the positive x-axis pointing towards the right, the positive y-axis pointing down,

更多推荐

为什么HTML/SVG坐标0,0从左上角开始?

本文发布于:2023-11-09 06:06:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1571587.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:左上角   坐标   HTML   SVG

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!